Perl Source Code

When saving, rename from *.pl.txt to *.pl or whatever you use for Perl. If using on Unix, you may need to convert CRLF to LF, and modify the "shebang" line (e.g. #!/usr/local/bin). " cleanup -u" can fix the line termination. Or find a good dos2unix and unix2dos program like those found in the UNXUtils.

Perl (Practical Extraction and Report Language or Pathologically Eclectic Rubbish Lister) is an interpreted language optimized for scanning arbitrary text files, extracting information from those text files, and printing reports based on that information. It's also a good language for many system management tasks. Start at www.perl.com, and check getting the latest Perl. See the Win32 section especially if you use Win95 or WinNT (Hint: these versions can access the NT event logs, making collection and auditing them much easier...). I use ActiveState's ActivePerl. I've also used IndigoStar's IndigoPerl (which has Apache built in) and Perl2Exe which can "compile" Perl. And check out the Open Perl IDE.


Scripts

Clicking on the name of a script will open that script in a new window.

CleanUp v1.9 2002-10-06
General purpose utility to clean up messy text files. Can convert tabs (see Tab above), UPPER or lower case the entire file, remove leading ">", trim, convert CRLF <--> LF, number output, etc. Ironocally, the code for this is very messy too. One of these days I need to start fresh, but...
CSV2html v2.3 2005-10-07
Turn a csv file into a simple HTML table. (Similar to HTMLTable.pl)
CSV2tab v3.5 2008-09-27
Convert CSV files to TAB delimited files.
DNSLookup.pl 1.0 2002-11-22
Lookup IPAs and get hostnames from STDIN or a file.
DoMath v1.2 2002-10-22
Perform math operations on arbitrary lines of numerical input
GenFiles v1.0 1998-03-07
Creates files of a certain size for testing purposes.
GenPass v3.0 2005-08-26
Generate random passwords of arbitrary length and complexity. v3 is a re-write to clean up the code and make it more modular. It also now changes interface modes based on script name (.cgi or .pl, still need to manually edit and add -T). New for 2.2 was dual interfaces--GenPass can run as a CGI script or from the command line. New for 2.1 was a Hex option, for generating WEP keys. Try the CGI/web interface!
GrepCount.pl v1.0 2003-03-21
Count the frequency of a list of regular expressions in arbitrary input data so that a file for use with 'egrep -f' can have the most frequent expressions first so it runs faster.
HTMLList.pl 1.0 2003-11-30
Create a *simple* HTML list from text input.
HTMLTable.pl 1.1 2003-11-10
Create a *simple* HTML table from (TAB delimited) text input. (Similar to csv2html.pl)
ipa2int.pl 1.1 2004-01-30
Translate an IP Address to a MySQL-style integer, or reverse. Useful for pre-precessing data (i.e. FW logs) before it is imported into MySQL.
pivot.pl 1.0 2003-09-19
Pivot cells (e.g. columns to rows) in a table
subtotal.pl v1.1 2003-06-26
Subtotal arbitrary line items. Assumes that the number to subtotal is the first field and that the rest of the line is the keyfield (i.e. hash value).
Merge v2.7 2002-09-30
A very UGLY and complicated but flexible generic program to merge two data files with a common, unique key.
MergeL v1.3a 2003-01-13
A more simple and generic program to merge lines two data files with a common, unique key. This program is similar to the UNIX join command, but is intended more to process TAB delimited files cut from and pasted back into a spreadsheet. It creates a table or matrix of data, where each line is merged on a unique key (hence MergeL).
WordFreq v1.0 2001-12-05
Count word frequency in a text file. Basics from 8.3, page 280 of the Perl Cookbook, I just added stop words.

GenSite

GenSite is the simple script (relative to "real" Content Management Systems (CMS) anyway) that creates the HTML code for this site. My main constraint is that the ISP where most of the site is hosted does not support SSI, CGI, or anything else that would facilitate a modern site. I have various reasons for staying there, not the least of which is inertia. So I needed a simple solution that would create a navigable site without any those technologies. Also, after the last redesign JavaScript fiasco, I wanted totally PURE HTML. Since the site is mostly static, that was fine, except for being able to actually maintain it. So I wrote this.

See the script code for lots more details.

GenSite.pl 1.12 2003-12-22
Generate a static HTML-only web site from templates. (See also my GenSite wrapper web.)

OLD

Some Perl modules you might need (especially since I used them in some of these scripts). Just extract the files (use WinZip) and copy *.pm to \perl\lib\Number, \perl\lib\time or the correct path.

Fix-wls v1.0a 19-Mar-2000
Converts those annoying WatchGuard *.WLS files to Self-Extracting archives. This is obsolete with current versions of Live Security.
LCaseHTML v1.1 05-Apr-1996
Converts HTML commands to lower case in HTML code, overwriting original file. (I got tired of inconsistent case on my HTML code. Talk about anal...)
URL2HTML v1.1b 15-Nov-2000
Converts URLs (in the form of URL{tab}description) to Bulleted HTML lists.