Mark Bergeron wrote:
I've come up with this work snippet:
chdir( "C:\\files\\" );
local( @files ) = <*.plx>;
foreach $file( @files ) {
if( !-d $file ) {
print " <br><a href=\"$file\">$file</a> \n";
}
}
how would I add dir to this in addition to the files?
What does that mean ? Do you mean you want to recurse down through the subdirs ?
If so, I would use File::Find.
Untested:
use strict;
use File::Find;
&find (\&wanted, 'C:/files');
sub wanted {
return if -d or not /\.plx/i;
print qq{ <br><a href="$_">$_</a>\n};
}
__END__
--
,-/- __ _ _ $Bill Luebkert ICQ=162126130
(_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED]
/ ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/_<_</_</_ Castle of Medieval Myth & Magic http://www.todbe.com/
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs