Perl Reference

Perl Add analytics snippet to batch of static html files

Sometimes it is necessary to measure hits on static html files. But having to add a small snippet of Javascript to a bunch of static files can be a real repetitive pain.

This is precisely the kind of thing that can be easily solved in a few lines of Perl. Here's one way to do it:

Perl List installed Perl modules using perldoc

-- Using perldoc

There are 2 commands, depending of the kind of perl module:


Perl date comparison example yyyymmdd

This Perl subroutine calculates and returns the amount of days between two yyyymmdd formatted dates:

Perl Scrape HTML and output RSS

This is just a quick simple example of scraping a html page's content and turning it into something else (RSS) using Perl regular expressions and the XML::RSS module.

Perl Directory file loop

This Perl script loops through the files in the specified directory:

[x]