On Thu, Mar 03, 2005 at 10:45:28AM -0500, Kripa Sundar wrote:
> An unnamed White House source today stated that regexes are
> beginning to infiltrate the RHS of substitutions, and thus
> threaten our national security.
>
> This was corroborated by the following sighting:
>
> > s/Perl/(Bike Riding|Gardening|Cooking|Painting|Teaching|Filmmaking)/;
Oddly enough, the the syntactically correct code does not quite have the same
meaning or elegance. Note that I modified the list slightly to avoid manual
quoting:
s/Perl/$z=sub { $_[rand(@_)] }; &$z(qw(Biking Gardening Cooking Painting
Teaching Filmmaking))/e;
-Gyepi
_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm