in reply to Can I tell a sub to take $_ instead of @_ (like some builtins do)
Beware of false laziness however. You should not use this kind of interface lightheartedly. Are you sure it is a better idea than just wrapping the inside of &foo with a for loop?sub foo { my $var = @_ ? \$_[0] : \$_; modify($$var); } foo for @list;
sub foo { for(@_) { modify($_); } } foo @list;
Makeshifts last the longest.
|
|---|