sub def_arg { my $arg = @_ ? shift : $_; print "got: $arg\n"; } $_ = "bar"; def_arg("foo"); def_arg(); __output__ got: foo got: bar
_________
broquaint
In reply to Re: passing $_ to my function
by broquaint
in thread passing $_ to my function
by arc_of_descent
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |