in reply to
Problem with regex passed to a hash
did you try doublequotes instead of singlequotes?
Thanks very much! It worked.
It looks like with single quotes I passing the regex as is, with no variable interpolation.
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.
A Programming Language, 1962
Programming the 1900 series in COBOL, 1974
Algorithms + Data Structures = Programs, 1976
The C Programming Language, 1978
System V - Interface definition, 1986
Z80 Assembly Language Programming, 1979
TheSOURCE User's Manual, 1979
The C Primer, 1983
Interactive Fortran 77, A Hands on Approach, 1984
Perl.1 man page, 1991
Results (63 votes),