in reply to string/array smart match regex failing me
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
|
|---|