[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] aCertainName.pm



Larry Rosler wrote:
> 
> my foo {
>    my $x = abs; # Sets @_ to $_.
>    &bar; # Expects the same arguments as foo(), namely none, but now
> gets $_.
> }
> 
> @_ has been 'clobbered' by abs()!


Huh?  It's only the ELEMENTS of @_ that can be clobbered,
not the @_ variable itself.

You may have been fooled by the fact that you called
the built-in abs(;$), rather than the user-defined one.
To demonstrate that, you need to call &abs.

-- 
John Porter


==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe