Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2018-07-23 03:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (459 votes). Check out past polls.

    Notices?