in reply to string/array smart match regex failing me

I get a different output:
(?i-xsm:foo)(?i-xsm:ba(r|z))(?i-xsm:quux) matched
What version of perl are you using?
$ perl -v This is perl 5, version 12, subversion 2 (v5.12.2) built for x86_64-li +nux

See also Smart match changes, for example.

Replies are listed 'Best First'.
Re^2: string/array smart match regex failing me
by hsinclai (Deacon) on Jan 05, 2011 at 21:10 UTC
    Same here, it worked on both of: 5.12.2 on fedora 14 and 5.10.1 on another linux

    use strict; use warnings; use 5.010; my $string = q(quux); my @patterns = map { qr/$_/i } qw( foo ba(r|z) quux ); say @patterns; if( $string ~~ @patterns ) { #say q(matched); say qq(This matched: $&); }
Re^2: string/array smart match regex failing me
by gizmo_mathboy (Friar) on Jan 06, 2011 at 01:37 UTC

    I'm using 5.10.0

    I didn't get around to testing it against something a bit more current but this is a work machine.

    Running on my machine at home (5.10.1) it matched.

    We do have 5.12.1 installed on a test machine and it worked as expected. I guess I need to pass along the request to put 5.12.1 into production.

    Thanks for the help everyone.