Gives Modification of a read-only value attempted which I can see might catch some people out. The fix is to defined $_ as a 'my' variable, but that rather defeats the object.sub mysub (_) { s/o/u/g; } for (qw(The quick brown fox)) { mysub() }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Underscore _ prototype in 5.10
by lodin (Hermit) on Jan 20, 2008 at 18:31 UTC | |
|
Re: Underscore _ prototype in 5.10
by kyle (Abbot) on Jan 20, 2008 at 15:48 UTC | |
|
Re: Underscore _ prototype in 5.10
by ikegami (Patriarch) on Jan 20, 2008 at 17:44 UTC | |
|
Re: Underscore _ prototype in 5.10
by cdarke (Prior) on Jan 20, 2008 at 20:38 UTC |