Categories

Category Specific RSS

list all files in directory with PERL

opendir(IMD, $dirtoget) || die(“Cannot open directory”);
@thefiles= readdir(IMD);
closedir(IMD);

print “Content-type: text/html\n\n”;
print “<html><body>”;

foreach $f (@thefiles)
{
unless ( ($f eq “.”) || ($f eq “..”) )
{
print “$f<br />”;
}
}

FacebookTwitterGoogle+PinterestTumblrStumbleUponRedditLinkedInBaiduApp.netBufferDeliciousDiggDiigoWordPressBlogger PostEmailPrintFriendlyShare

Leave a Reply