perl
| toolbox | services | architecture | finance | payments | identity | xml | klogs | perl | books |

daily link  Sunday, July 07, 2002

Allison Randal, Damian Conway: Synopsis 5. "Just as you can have anonymous subs and named subs you can have anonymous regexes and named regexes:"

 rule ident { [<alpha>|_] \w* }
 # and later...
 @ids = grep /<ident>/, @strings;
 # and then refer to named regexes, such as:
 rule serial_number { <[A-Z]> \d<8> }
 rule type { alpha | beta | production | deprecated | legacy } 
Neat and slightly shocking (for someone who's been doing Perl for eight years) syntax.
permalink Posted to perl @ 5:41:04 PM ( comments)


Copyright (C) 2002 Paul Kulchenko Click here to send an email to the editor of this weblog. Updated 8/11/2002; 7:05:03 PM