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

c# - HttpResponseMessage System.InvalidOperationException -

sql - Postgresql error: "failed to find conversion function from unknown to text" -