in reply to Re: How can I avoid code repetition here
in thread How can I avoid code repetition here
Your code will not work if $_ is lexical.You can't make $_ a lexical:
$ perl -lwe "my $_='abc'; chop; print" Can't use global $_ in "my" at -e line 1, near "my $_" Execution of -e aborted due to compilation errors.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How can I avoid code repetition here
by JavaFan (Canon) on Oct 08, 2009 at 09:48 UTC | |
by rovf (Priest) on Oct 08, 2009 at 10:56 UTC | |
by JavaFan (Canon) on Oct 08, 2009 at 11:45 UTC | |
by rovf (Priest) on Oct 08, 2009 at 14:24 UTC | |
by JavaFan (Canon) on Oct 08, 2009 at 15:07 UTC | |
|