Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Creating a txt file with paths to all files

by earthboundmisfit (Chaplain)
on Jun 19, 2002 at 16:20 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://175758]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-03-29 09:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found