December 5th, 2013, 08:24 AM
Saving response in telnet
Hello! I am perl newbie and trying to write a script that will save the telnet answer into a file after executing command, but the only thing i have successfully made is the output of executing command :RESPONSE: VAR1 =1, instead of full answer, that consists of nearly page.
Here is that part of code:
$response = $telnet-print('ZMIO:IMSI=xxxxxxxxxxxxxxxx:;');
ZMIO:IMSI=xxxxxxxxxxxxxxxx:; - is command, that i need to "catch" from telnet. Connection to telnet host and logging is successful. Would be grateful for any help and advising.
December 5th, 2013, 09:32 AM
If you need to retrieve the output of the command, you need to use the cmd method, not the print method and you need to use an array instead of a scalar.
my @response = $telnet->cmd('ZMIO:IMSI=xxxxxxxxxxxxxxxx:;');
December 5th, 2013, 09:55 AM
Originally Posted by FishMonger