Hello List,

It just occurred to me that many Perl functions use $_ if not other value is supplied. chomp for instance..., which is very handy...

If one wanted to write a function that used either the given argument or $_ how would you do that?

 myfunc($myvalue);
or
 myfunc; #uses the current value of $_

sub myfunc {

my $func_arg = shift || ????; # you wouldn't just do '|| $_;' would you?

...

TIA

Lee.M - JupiterHost.Net

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to