in reply to Re^2: Identifying Reverse Position of Specific Character in a String
in thread Identifying Reverse Position of Specific Character in a String
There's no benefit to that in this case, since the function makes no attempt to alter $_.
Furthermore, using the for(shift) idiom with code that does modify $_ is dangerous, unless your intent is to modify $_[0].
As for pos, one of the lessons you do (or should) learn early in your Perl edjication is to call pos as soon after the regex that sets it as possible — ideally, immediately after it. Otherwise, you're taking a gamble.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Identifying Reverse Position of Specific Character in a String
by ikegami (Patriarch) on Aug 25, 2006 at 20:02 UTC | |
by jdporter (Paladin) on Aug 25, 2006 at 20:18 UTC |