in reply to Distinguishing files from folders

Use -d ... like :
# get $filename if (-d $filename) { # a dir } elsif (-f $filename) { # a normal file } else { # something else }

from the frivolous to the serious

Replies are listed 'Best First'.
Re: Re: Distinguishing files from folders
by Kalimeister (Acolyte) on Jan 15, 2002 at 21:31 UTC
    Most excellent. Thank you very much. I must say that this is a great site in my quest to learn Perl. Everyone is very helpful and quick to offer advice. Thank you.
    Kalimeister
Re: Re: Distinguishing files from folders
by Erik Hensema (Sexton) on Jan 15, 2002 at 22:42 UTC
    Also note that on all platforms I'm aware of, directories can have extensions. And files are certainly not required to have extensions.