November 17, 2008

PERL: Snippet which traverses from root folder to sub folder inside it

use strict;


sub smash {
my $dir = shift;
opendir DIR,
$dir or return;
my @contents = map "$dir/$_", sort grep !/^\.\.?$/, readdir DIR;
closedir DIR;
foreach (@contents) {
next unless !-l && -d;

November 8, 2008

How do I install Perl modules?

"Installing a new module can be as simple as typing perl -MCPAN -e 'install Chocolate::Belgian'"