Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: Problem with regex passed to a hash

by oldwarrior32 (Sexton)
on Oct 02, 2012 at 00:49 UTC ( #996779=note: print w/ replies, xml ) Need Help??


in reply to Re: Problem with regex passed to a hash
in thread Problem with regex passed to a hash

Thanks very much! It worked.

It looks like with single quotes I passing the regex as is, with no variable interpolation.


Comment on Re^2: Problem with regex passed to a hash
Re^3: Problem with regex passed to a hash
by LanX (Canon) on Oct 02, 2012 at 09:30 UTC
    > It looks like with single quotes I passing the regex as is

    not exactly. your passing the variable's symbol.

    Seems like that module does an eval on the string you pass.

    So passing in singelquotes means that eval '/$username/' fails because $username is unknown in the module's namespace.

    Cheers Rolf

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2014-12-21 11:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (104 votes), past polls