Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: File::Find and replacing spaces in filenames.

by Anonymous Monk
on Dec 22, 2012 at 19:11 UTC ( [id://1010039]=note: print w/replies, xml ) Need Help??


in reply to File::Find and replacing spaces in filenames.

Your logic ends up like this:

  1. Enter directory
  2. Call wanted() sub, which renames the directory
  3. Return from the sub
  4. Get confused, since the directory we're in no longer exists

You can make it work correctly if you only do the renaming after you've finished with the directory's children. File::Find provides the bydepth option to do that. (Or alternatively, the finddepth() subroutine)

Replies are listed 'Best First'.
Re^2: File::Find and replacing spaces in filenames.
by Kyshtynbai (Sexton) on Dec 22, 2012 at 19:59 UTC
    Thank you a lot! I should have read the description of the module more carefuly.
      I should have read the description of the module more carefuly.

      Amen brother, amen!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1010039]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-04-25 22:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found