http://www.perlmonks.org?node_id=996779


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

Replies are listed 'Best First'.
Re^3: Problem with regex passed to a hash
by LanX (Saint) 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