Re: RFC 170 (v2) Generalize =~ to a special "apply-to" assignment operator
[email protected] (Nathan Wiger) Tue, 26 Sep 2000 18:38:07 -0700
| Newsgroups | perl.perl6.language.regex |
|---|---|
| Message-ID | <[email protected]> |
Simon Cozens wrote:
>
> Looks great on scalars, but...
>
> @foo =~ shift; # @foo = $foo[0] ?
> @foo =~ unshift; # @foo = $foo[-1] ?
Yes, if you wanted to do something that twisted. :-) It probably makes
more sense to do something like these:
@array =~ reverse;
@vals =~ sort { $a <=> $b };
@file =~ grep /!^#/;
> Although I have to admit I like:
>
> @foo =~ grep !/\S/;
Exactly!
> But I'm not very keen on the idea of
>
> %foo =~ keys;
Again, that depends on whether or not you're Really Evil. ;-)
-Nate