Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use warnings; use strict; my @dic = qw#beriberi hanabbs#; for (@dic) { print "trying to match $_\n"; print $_ if $_ =~ m#^(hana)(bbs)?(?(1)\2\1|\1)$#; }
yahoo@myserver ~/.yahoo/perl> !$ simple_grep.pl trying to match beriberi trying to match hanabbs yahoo@myserver ~/.yahoo/perl>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: conditional expression testing
by ikegami (Patriarch) on Jun 01, 2010 at 16:26 UTC | |
by Anonymous Monk on Jun 01, 2010 at 16:35 UTC | |
by ikegami (Patriarch) on Jun 01, 2010 at 16:51 UTC | |
|
Re: conditional expression testing
by choroba (Cardinal) on Jun 01, 2010 at 16:24 UTC |