Kent's Perl Stuff
I generally use Perl for quick parsing and report generating tasks that
are of a one-time-only nature. The following Perl programs are some
that have been frequently used by myself and others in a more general
context. They are probably not finished nor elegantly programmed, but
they work for me the way I originally wanted. I'm providing them 'as
is.' No guarantees, no warranty of fitness for a particular purpose
implied, etc. Copy, use, and alter them as you will. All were developed
on Unix systems (Solaris, FreeBSD, HPUX) but should be portable to
MS-DOG. Perl version 5.X is assumed unless noted.
- Compute frequency
counts for alphanumeric values in a column range.
Answers the question "how many times do the unique values in
columns x through y occur in this
file?". Modified 3/17/01 to include a -n parameter to use a numeric
sort.
-
- Frequency counts
w/percentages adds percentages & cumulative percentages to
the frequency count script above. Modified 3/17/01 to include
a -n parameter to use a numeric sort.
-
- Block a stream data
file to fixed line length by inserting newlines at a
user-specified logical record length.
-
- Report quoted strings exceeding
a specified length in a text file (such as SPSS or SAS
variable labels).
-
- Print a calendar with today's date
highlighted Assumes VT100-compatible terminal emulation and
an available Unix 'cal' command.
-
-
- Split a multi-column SAS input or
SPSS data list statement into a single column.
-
- Wrap a single column SAS input or
SPSS data list statement into multiple (5) columns.
-
- Report lines with trailing white space
A bit of silliness for those who might not believe their files
have trailing blanks or tabs.
-
- Convert tabs to spaces (2 different ways)
Two methods for converting tabs to spaces. One way is to replace
every tab with a user-defined fixed number of spaces. Another is to assume a
user-defined fixed number of spaces per tab, but also take into account the text
already on the line (sort of like a typewriter tabbing to a specific spot).
A Few Perl Links
Here are some Perl web sites worth visiting if you are interested in
learning about the Perl language, or need to find other Perl scripts and
tools.
- Main Perl.org Page
Offers links to many Perl resources, including links to pages on development,
applications, introductions, manual pages, FAQs, mailing list archives, and
downloading a Perl version.
-
- The Perl FAQs
The Frequently Asked Questions file(s) for Perl (in HTML format). Very helpful!
-
- Perl Download Page
Get Perl for your operating system (it may already be included in your OS).
Links to Strawberry Perl and ActiveState Perl for Windows.
-
- Perl.com Main Page
News site run by O'Reilly.
-
- Comprehensive Perl Archive Network (CPAN)
"...hundreds of Perl utilities, several books' worth of documentation, and the
entire Perl distribution. If it's written in Perl, and it's helpful and free, it's in the
CPAN." Perl modules can be found here, also.
-
- The Perl Archive
An assortment of categorized Perl code. Over 3700 listings in the archive.
-
- The Perl Journal
The Perl Journal has ceased publication. There are only the articles from past issues.
This is an index to those articles.
-
- Perl Mongers
A not-for-profit organization set up to establish and support Perl user groups.
-
- Perl Monks
Instant answers and accumulated wisdom for solving common Perl problems.
-
This page has been visited
times since November 27, 1998.
Back to Kent's Home Page