Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Problem with regex passed to a hash

by LanX (Chancellor)
on Oct 02, 2012 at 00:12 UTC ( #996775=note: print w/replies, xml ) Need Help??


in reply to Problem with regex passed to a hash

did you try doublequotes instead of singlequotes?

Cheers Rolf

  • Comment on Re: Problem with regex passed to a hash

Replies are listed 'Best First'.
Re^2: Problem with regex passed to a hash
by oldwarrior32 (Sexton) on Oct 02, 2012 at 00:49 UTC

    Thanks very much! It worked.

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

      > 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://996775]
help
Chatterbox?
[Cosmic37]: greetings earthlings please can someone improve my pathetic perl knowledge
[Cosmic37]: I have 2 files each with datetime and other data in unknown order and I want to find rows from both files matching by datetime and output them combined/ concatenated
[Corion]: Sure
[Corion]: Do you have any specific interests or general Perl knowledge?

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (11)
As of 2017-06-29 16:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (672 votes). Check out past polls.