On Fri, 02 Apr 2004 10:37:14 -0600
"JupiterHost.Net" <[EMAIL PROTECTED]> wrote:

> 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?

$_ is global, so do something like:

sub test {

        my $arg;
        $arg = shift or $arg = $_;
}

-- 
Smoot Carl-Mitchell
Systems/Network Architect
email: [EMAIL PROTECTED]
cell: +1 602 421 9005
home: +1 480 922 7313

-- 
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