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

Re^3: Expect question

by Crackers2 (Parson)
on Oct 27, 2007 at 00:37 UTC ( [id://647525]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Expect question
in thread Expect question

I might be wrong of course, but it looks to me like that's just the parsing of the parameter you gave to the function, not what was received from the server.

Could the problem have something to do with the "exact match" part? You can see it's trying to match against 'Connecting to <host_ip>...\r\nPassword: '

So perhaps you need something like '.*Password: ' as a pattern? (assuming it takes regexes).

Replies are listed 'Best First'.
Re^4: Expect question
by RaduH (Scribe) on Oct 29, 2007 at 15:30 UTC
    I have replaced my "Password: " pattern with the entire Connecting to... blah blah string and that one is matched. The regexp does not work which seems weird. In this case it's easy to either use the entire string or even generate it before using it, so I can use the IP and a parameter, but it just doesn't feel right. Somehow I suspect I should be able to verify only the last part of a return... I can easily imagine servers that spit out a whole load of stuff before prompting you for an input and I just don't think we always need to search and match that entire speech... At least I know it's about tail matching now.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-26 03:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found