in reply to Re: How to make code smaller--saving steps and writing one liners
in thread How to make code smaller--saving steps and writing one liners

Use local $_=$_; in the "wanted" callback and you can modify it as you like.
Or just modify it as you like :) File::Find doesn't mind
  • Comment on Re^2: How to make code smaller--saving steps and writing one liners

Replies are listed 'Best First'.
Re^3: How to make code smaller--saving steps and writing one liners
by afoken (Chancellor) on May 09, 2009 at 15:08 UTC

    You are right, I was too careful here. The written contract (the File::Find documentation) explicitly states:

    The above variables [$File::Find::dir, $File::Find::name, and $_] have all been localized and may be changed without effecting data outside of the wanted function.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)