in reply to noshow by file extension
opendir(DIR, $directory) || die print "Couldn't open directory"; my @unscont = readdir(DIR); closedir(DIR); ## Sorts and Extracts in one statement(each) my @files = sort grep(/\./, @unscont); my @dirs = sort grep(!/\./, @unscont); ## Removes 1st two elements '.' & '..' @files = @files[2..$#files]; my @noshow = (".py", ".html"); foreach $f (@files) { my $switch = true; foreach $n (@noshow) { if($f =~ /$n$/) { $switch = ''; } } if($switch) { print " <a href=\"./this?func=read&file=$f&dire=$dire\">$f</a><br +>\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re:x2 noshow by file extension
by grinder (Bishop) on Jun 03, 2002 at 13:30 UTC |