What is the use `-d` in Perl? -


this question has answer here:

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

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -