in reply to Re^4: Strange modification of @_
in thread Strange modification of @_
- the caller needs to know that the argument to fn() will be used directly from @_ after a regexp, or
- the function needs to know that the argument is an alias of a global variable which will be modified by the regexp.
Not true. Just use the standard calling convention.
sub f { my (...) = @_; ... }
I think the takeaway for me is that when passing $1, etc into a function, that it should be quoted (to copy it)
Maybe. I would have thought it was: There are risks in avoiding the standard calling convention.
You're doing something unnatural then claim you have to take unnatural measures to avoid the resulting problems.
You increase cohesion by using aliases then complain of the increased cohesion.
What would like from us?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Strange modification of @_
by jrw (Monk) on Apr 24, 2009 at 20:51 UTC | |
by ikegami (Patriarch) on Apr 24, 2009 at 21:58 UTC |