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

there is detailed info on stat() at http://www.perldoc.com/perl5.6.1/pod/func/stat.html

summary: in array context, it returns a 13 element array. element 2 is what you want to examine. I.E.
my @stat_info = stat($filename); my $file_mode = $stat_info[2]; ... # or my $file_mode = (stat($filename))[2]; my $file_type = S_IFMT($file_mode)
file type is still just a bit string, but see the bottom of the above linked page for how to interpret those bits.