"Rob Dixon" <[EMAIL PROTECTED]> writes: > So you can use: > > if (-f $file) { > : > # process file > } > elsif (-d $file) { > : > # process directory > }
Well, yes of course I can run each filename thru all those tests, but that seems kind of like a lot of huffing and puffing. I wondered if there isn't something that just spits it out. perl `stat' does do that very thing in element[2] ($mode) but extracting `type' from that number looks hideously complicated. Maybe running all possible tests is quicker and easier after all. It would really come down to just these: -f -d -l -b -c -p -S But all that info is available in @elems = (stat "fname"); Unix `stat' actually spits it out in plain english, what type it is. (at least gnu `stat' does) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]