in reply to Re: Mathching an array in regex
in thread Mathching an array in regex

Thanks for introducing me to perl -MO utility, can you direct me to the documentation on that, I don't find it in perldoc:perl -MO=Deparse test.pl.I disagree with you on the point that @arr is not expanded, the following code produces Matched as o/p (Note the $str1 value and array)
#!/usr/bin/perl use strict; use warnings; my @arr=('cool','guy','here'); my $str1="cool guy here"; if($str1 =~ m/@arr/){ print "Matched"; }

The world is so big for any individual to conquer

Replies are listed 'Best First'.
Re^3: Mathching an array in regex
by Krambambuli (Curate) on Oct 12, 2007 at 12:46 UTC
    Look for B::Deparse for the docs. The module is unvaluable sometimes

    To the @ expansion in regexes: you're right, of course. I think I just never have tried it, and so I had an 'explanation' at hand.
    Sorry.