Compare:
Lacking the _ prototype, you original code would not work for the case of lexical $_ not in the same scope as the function definition.sub f {say @_ ? $_[0] : $_} sub g (_) {say @_ ? $_[0] : $_} $_ = "outer"; { my $_ = "inner"; f; g; } __END__ outer inner
In reply to Re^11: How can I avoid code repetition here
by JavaFan
in thread How can I avoid code repetition here
by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |