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

python - Referencing Data From a 2D Histogram -

c# - Derived UserControl layout resets after build -

php - MySQL LIMIT results with INNER JOIN with more than 2 tables -