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

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

by cdarke (Prior)
on Dec 29, 2008 at 11:01 UTC ( #732999=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

Your inner foreach loop needs attention. You are altering the filename to the new filename, but not saving it for the rename. Using "$one" as a variable name it not very descriptive either. I suggest:
foreach $file (@files) { rename $file,"reference_$file" }
(Untested)
  • 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://732999]
help
Chatterbox?
and all is quiet...

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




















    Results (462 votes). Check out past polls.

    Notices?