Wednesday, April 23, 2008

perl directory



How to read a directory in Perl.

Something like:


#!/usr/bin/perl -w

@files = <*>;
foreach $file (@files) {
print $file . "\n";
}