Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

13. Directory Operations > Recursive Directory Listing

Recursive Directory Listing

You probably won’t need recursive directory access for the first few dozen hours of your Perl programming career. So rather than distract you with the possibility of replacing all those ugly find scripts with Perl right now, we’ll simply entice you by saying that Perl comes with a nice library called File::Find, which you can use for nifty recursive directory processing. We’re also saying this to keep you from writing your own routines, which everyone seems to want to do after those first few dozen hours of programming, and then getting puzzled about things like “local directory handles” and “how do I change my directory back?”

If you are already using Unix find commands to get work done, you can convert them to Perl programs with the find2perl program that comes with Perl. You give it the same arguments that you use with find and it spits out the equivalent Perl program:


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial