if ( -f $file ) { .... } ## $file is a file elsif ( -d $file ) { ... } ## also could use '_' for speed else { ,,, } ## Not what we're looking for