On Sun, Jan 28, 2001 at 01:26:09AM +0100, [EMAIL PROTECTED] wrote:
> On Sat, Jan 27, 2001 at 05:13:23PM -0500, Michael G Schwern wrote:
> This one not only modifies its arguments (or $_ when called without),
> it also has the right prototype and works on lists:
> 
>     sub chop (@) {
>         my $__;
>         map {$__ = substr $_ => -1, 1, ""} @_ ? @_ : $_;
>         $__;
>     }
> 
> Aliasing is a cute thing.

I keep forgetting you can modify @_ in place.  However, the prototype
on chop is beyond Perl's system.  5.6 reports it as undef, but 5.7.0
says @.  Odd.  5.7.0 also adds the additional complexity of dealing
with hashes.  C<chop(%hash)> is supposed to work... and it does (on
your routine).  How does that work?  I'd expect %hash to be fed to the
subroutine as a list.

-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Paste is a waste if you're chaste,
but in this case dump a load
of goo and poo by the case in your face,
and place in your jawls like a juicy chaw,
but don't spit that shit and enjoy it all.
        -- Ubergirl's beau

Reply via email to