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 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!
-
- The Perl Primer
A page geared toward the beginning Perl programmer. This site has advice on what
books to read, common mistakes and problem solving, other Perl internet resources,
and a Perl/CGI tutorial.
-
- Perl Download Page
Includes Perl news, documentation, and software.
-
- Perl Resources Page
A ton of information, resources, sources, and links to perl-related stuff. Here you'll
find information on CGI, regular expressions (regex), using perl for system
& web administration tasks, date & time usage, text tools, Perl for Windows 3.1/95/NT,
and much more.
-
- 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
Home page for "The first and only periodical devoted to Perl." The site includes
listings for the programs discussed in the journal. Part of Dr Dobb's Portal now.
-
- 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