JavaFan nailed it, but here's a way to do what you want:
#!/usr/bin/perl -w use strict; use 5.010; my $string = q(foo); map { say "$_: ", $string =~ /$_/i?"Matched":"No match" } qw( foo ba(r +|z) quux );
Update: Added the 'Matched/No match' bits.
-- Education is not the filling of a pail, but the lighting of a fire. -- W. B. Yeats
In reply to Re: string/array smart match regex failing me
by oko1
in thread string/array smart match regex failing me
by gizmo_mathboy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |