Re: What's in a Regex (was RFC 145)

[email protected] ("mike mulligan") Thu, 7 Sep 2000 11:44:48 -0400
Newsgroups perl.perl6.language.regex
Organization Northern Light Technology
Message-ID <[email protected]>
From: Tom Christiansen <[email protected]>
Sent: Thursday, September 07, 2000 11:20 AM

> Which can of course be written in an immeasuably more legible fashion
> using current Perl, a little-known language:
>
>     ($name) =  split /\s+/, $name;
>     $string =  quotemeta($string);
>     @array  =  reverse @array;
>     @vals   =  sort { $a <=> $b } @vals;
>
> Explicitly saying precisely what you mean is perfectly acceptable--and
> usually desirable.  Inventing subtleties merely to avoid typing, however,
> may not be.

Certainly a good point.  In that we do have the += family of assignment
operators, does anyone find anything attractive in the following?

     split= /\s+/, $name;
     quotemeta= $string;
     reverse= @array;
     sort= { $a <=> $b } @vals;

 - mike mulligan