use strict; use warnings; use diagnostics; use File::Slurp; use Cwd; for(;;){ my @files; my $dir; print "enter path: "; chomp( $dir = <STDIN> ); chdir($dir); $dir = getcwd($dir); print $dir; # print "enter match string: "; # chomp( my $string = <STDIN> ); @files = read_dir($dir); foreach my $element (@files) { next if -f $element; print "$element\n"; } foreach my $element (@files) { next if -d $element; print "$element\n"; } print "\ncurrent dir is: $dir\n"; print "\n"; system("pause"); system("cls"); }
In reply to Re^2: Perl script does not work on other directories?
by james28909
in thread Perl script does not work on other directories?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |