Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Problem with regex passed to a hash

by oldwarrior32 (Sexton)
on Oct 02, 2012 at 00:54 UTC ( #996781=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

With qr doesn't appears the error, but there is no match(?)

Gonna study the qr function. Thanks!


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 pokki (Scribe) on Oct 02, 2012 at 09:35 UTC

    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.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (10)
As of 2015-07-07 22:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls