On Sun, Jan 28, 2001 at 12:57:07AM -0500, Michael G Schwern wrote:
> 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.


Aliasing again. They keys are copies, the values aliases.



Abigail

Reply via email to