Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Mathching an array in regex

by narainhere (Monk)
on Oct 12, 2007 at 12:21 UTC ( [id://644453]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://644453]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-25 05:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found