Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: Need help getting output from Telnet into a string or array

by jhourcle (Prior)
on Mar 15, 2012 at 21:43 UTC ( [id://959867]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Need help getting output from Telnet into a string or array
in thread Need help getting output from Telnet into a string or array

I looks like someone else has done similar work.. In their example, they used:

 Prompt     => '/'.$switch.'.*?# /',

... where $switch is the name of the switch ... so the text of the prompt would be the switchname and maybe something else, ending in '# '

... but they also had to do extra checking to deal with some other differences between software versions, so this may be a more complex beast to deal with. Odds are, with any piece of networking gear that's out there, someone's already figured out how to interact with in in Perl, even if it means screen scraping HTML GUIs, so it's worth searching for "(hardware name) perl" in your preferred search engine.

Replies are listed 'Best First'.
Re^4: Need help getting output from Telnet into a string or array
by TravisC (Novice) on Mar 16, 2012 at 15:28 UTC
    Thanks for the post. Right now I think it has more to do with my inexperience of passing values in a list context to an array than it does with the switch. I've tried creating the same desired result on other prompts (telnet on my local desktop) and got nothing but failure. Like I said in one of my previous posts, I'm able to pass the individual lines to $values but unable to pass the list context values to an @array. Any and all help would be greatly appreciated. Thanks!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-19 20:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found