Flynt has asked for the wisdom of the Perl Monks concerning the following question:
I'll try to ask this as clearly as I can. Can't seem to find an answer to how to fix this. Currently I am using the telnet module to login to a machine and retrieve information using a simple info command(it retrieves machine type, serial number, MAC addresses, etc.) The problem I am having is the output contains -> as one of the MAC address entries.
When I get to that entry, perl stops trying to gather more data and my script stops. Here's the snippet of code. As you can see, it's very simple.
$telnet->print("info -T system:$target"); @infosyst=$telnet->waitfor('/>/i');
Now I can also just print the result with print $telnet->waitfor('/>/i'); Either way, the output is the same
Where I should receive this as the output
MAC Address 1: 00:1A:64:85:B2:C0 -> 00:1A:64:85:B2:CF
MAC Address 2: Not Available
MAC Address 3: Not Available
MAC Address 4: Not Available
MAC Address 5: Not Available
MAC Address 6: Not Available
MAC Address 7: Not Available
MAC Address 8: Not Available
How do I tell it to ignore that as a command? telnetmode does not work for this case.
All help appreciated,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perlnet Telnet issue with ->
by bv (Friar) on Jan 15, 2010 at 20:26 UTC | |
|
Re: Perlnet Telnet issue with ->
by MidLifeXis (Monsignor) on Jan 15, 2010 at 20:19 UTC | |
|
Re: Perlnet Telnet issue with ->
by keszler (Priest) on Jan 15, 2010 at 20:30 UTC | |
|
Re: Perlnet Telnet issue with ->
by Flynt (Initiate) on Jan 17, 2010 at 17:38 UTC |