in reply to Re^2: How to read files in a directory, directory path to be given through CMD
in thread How to read files in a directory, directory path to be given through CMD
use strict; use warnings; foreach my $file (@ARGV) { if (-f $file) { print "This is a file: $file\n"; } if (-d $file) { print "\n\nThis is a directory: $file\n"; } }
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
|
|---|