Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re^3: Problem with regex passed to a hash

by pokki (Monk)
on Oct 02, 2012 at 09:35 UTC ( #996827=note: print w/ replies, xml ) Need Help??

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

Yeah, Net::Telnet is rather old and uses a weird method of passing regexes as arguments. For a more recent module qr// would be appropriate, but Net::Telnet requires a string that starts and ends with a slash.

The other posters are right when they say you should double quote. Any method for building strings will work:

'/'.$username.'/' "/$username/" sprintf('/%s/', $username)
As an aside, if you're trying to log in, there's a login method in Net::Telnet.

Comment on Re^3: Problem with regex passed to a hash
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2015-11-28 14:12 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (742 votes), past polls