in reply to File::Find and $_ in the wanted sub
If you want something in $_, put it in $_.
#!/usr/bin/perl testy() for 'i am a nice parameter'; sub testy { print "$_\n"; }
I used for to assign in order to $_ to protect the previous value of $_. Clobbering your caller's $_ is a bad idea.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: File::Find and $_ in the wanted sub
by rastoboy (Monk) on Jun 04, 2010 at 20:28 UTC | |
by ikegami (Patriarch) on Jun 04, 2010 at 21:48 UTC | |
by bart (Canon) on Jun 06, 2010 at 13:03 UTC |