Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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 cooling their heels in the Monastery: (2)
As of 2017-10-17 22:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (239 votes). Check out past polls.

    Notices?