in reply to
directory or file?
To test if is a directory, use the
-d
file test operator. For example, this code would print "foo" if /bar was a directory.
print "foo\n" if (-d "/bar");
[download]
To test if something is a file, use the
-f
file test operator.
Comment on
Re: directory or file?
Select
or
Download
Code
In Section
Seekers of Perl Wisdom