in reply to How to determine a file's type via stat()

I don't think that you can do it with stat, but perldoc -f -X will tell you another simple way to do what you want. In brief:

my $filename = "/path/to/file"; print "Regular file\n" if (-f $filename); print "Directory\n" if (-d $filename); print "Symlink\n" if (-l $filename); print "Pipe\n" if (-p $filename); print "Sockete\n" if (-S $filename); ...

Leonid Mamtchenkov aka TVSET