in reply to Re^7: How can I avoid code repetition here
in thread How can I avoid code repetition here
you do believe that my $str = "..."; chop $str modifies the lexical
Yes, with *explicit* passing of a lexical, it is easy to understand how it is done; and if the compiler "knows" about chop (as a 'builtin' function), I can understand now how this work for this case. I wonder whether it would also be possible to write a user defined sub which, when called without parameters, acts on $_ even if it was lexically declared. I don't see how this can be done...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^9: How can I avoid code repetition here
by JavaFan (Canon) on Oct 09, 2009 at 08:36 UTC | |
by rovf (Priest) on Oct 12, 2009 at 09:43 UTC | |
by JavaFan (Canon) on Oct 12, 2009 at 11:03 UTC | |
by rovf (Priest) on Oct 12, 2009 at 11:10 UTC | |
by JavaFan (Canon) on Oct 12, 2009 at 11:17 UTC | |
| |
|
Re^9: How can I avoid code repetition here
by Anonymous Monk on Oct 09, 2009 at 08:21 UTC |