if($_ =~ m/^[$FORM{'sortby'}]/){ #### ############################################### #!/usr/bin/perl -w use CGI::Carp qw(fatalsToBrowser); $viewdirpath =""; # path $viewdirpath_only = ""; # url print "Content-type: text/html\n\n"; opendir DIR, "$viewdirpath"; @$_ = readdir DIR; closedir DIR; $count = 0; foreach $_ ( sort @$_ ) { $fitem_pathname = "$viewdirpath" . "/" . "$_"; if (-e $fitem_pathname) { if (-d $fitem_pathname) { unless ($_ eq "..") { unless ($_ eq ".") { $count++; } } } } } print ""; print "Folders Listed In Directory - $count
"; print "sort by
"; print ""; foreach $_ ( sort @$_ ) { $fitem_pathname = "$viewdirpath" . "/" . "$_"; if (-e $fitem_pathname) { if (-d $fitem_pathname) { unless ($_ eq "..") { unless ($_ eq ".") { if($_ =~ m/^[$FORM{'sortby'}]/){ @$_ = sort { $a cmp $b } @$_; print "
$_"; } } } } } } #print "$footer"; }