What is the use `-d` in Perl? -
this question has answer here:
- using -d test operator in perl 3 answers
what -d
in following piece of code:
foreach $filename (@files) { $filepath = $dir.$filename; next if -d $filepath; function1(); }
this short form for
if (-d $filepath) { next; }
where -d $filepath
test if $filepath
directory.
see http://perldoc.perl.org/functions/-x.html full list of file tests.
Comments
Post a Comment