Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Traverse a directory

by zentara (Archbishop)
on Sep 05, 2012 at 10:48 UTC ( #991806=note: print w/ replies, xml ) Need Help??


in reply to Traverse a directory

Also see Extract file type from stat() mode

#!/usr/bin/perl -w use strict; use File::Find; # my @directories = ('/dir1','/dir2'); my @directories = ('.'); # for testing this example find(\&wanted,@directories); sub wanted { my ($dev, $ino, $mode, $nlink, $uid, $gid) = lstat($_); print $File::Find::name . " $dev "."$mode "."\n"; }

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh


Comment on Re: Traverse a directory
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://991806]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (9)
As of 2015-07-07 05:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (87 votes), past polls