Ahh, so you do not intend STDIN, but rather @ARGV for your input. In that case, you might use
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.
| [reply] [d/l] |
Can't do inplace edit: C:\Perl64\bin is not a regular file at t1.pl line 20.
How can you possibly be getting a error on line 20 of kennethk's code, when neither version of the code he posted has 20 lines?
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
| [reply] |