Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Creating a txt file with paths to all files

by earthboundmisfit (Chaplain)
on Jun 19, 2002 at 16:20 UTC ( #175758=note: print w/replies, xml ) Need Help??


in reply to Creating a txt file with paths to all files

Sounds like a job for File::Find
#! Perl -w use strict; use File::Find; my $fdir='C:'; my @filelist = (); find(\&wanted, $fdir); write_file() if (@filelist); sub write_file() { .... # sub that writes @filelist to a text file } sub wanted { my $thisfile = $File::Find::name; push(@filelist, $thisfile) if ($thisfile =~ m/\.txt/); #for ex +ample }
hth

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2018-11-15 17:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My code is most likely broken because:
















    Results (189 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!