print "enter path\n"; $path = <>; chomp($path); opendir (DIR, $path) or die $!; while (my $file = readdir(DIR)) { if(-f $file) { print "this is a file--->".$file."\n"; } } closedir(DIR);
In reply to Re: How to read files in a directory, directory path to be given through CMD
by ansh batra
in thread How to read files in a directory, directory path to be given through CMD
by ckj
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |