Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: How to prefix a string to all the files in a directories as well subdirectories

by zentara (Archbishop)
on Dec 29, 2008 at 16:06 UTC ( #733058=note: print w/replies, xml ) Need Help??


in reply to How to prefix a string to all the files in a directories as well subdirectories

If you are going to be modifying directory names, I suggest you read "perldoc File::Find" and search for the section "finddepth", here is a start at it.
#!/usr/bin/perl use warnings; use strict; use File::Find; $|++; my $path = '.'; finddepth (\&wanted,$path); sub wanted { return unless -d; #-d for dir ops -f for files or comment out for bo +th return $File::Find::prune = 1 if $File::Find::name eq '.'; print "$_\n"; print "$File::Find::name\n"; } __END__

I'm not really a human, but I play one on earth Remember How Lucky You Are
  • Comment on Re: How to prefix a string to all the files in a directories as well subdirectories
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://733058]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2017-12-17 11:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (464 votes). Check out past polls.

    Notices?