http://www.perlmonks.org?node_id=1032819


in reply to Array not storing the result of a router command

Hi Arun Kumar,
Just Curious questions:

  1. Why test for the variable $type twice in your script?
  2. for this particular router, can you test another command to see if @cmd_output would not return null? like say:
    my @output = $session->cmd('show version'); print @output;
  3. In your print line, i.e print "Array value__________________'@cmd_output'\n"; why put the variable @cmd_output in a single quote? Does other router output give output in that like?
Just thinking aloud....

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me

Replies are listed 'Best First'.
Re^2: Array not storing the result of a router command
by Arun Kumar (Novice) on May 09, 2013 at 19:28 UTC

    Hi 2teez, Sorry for that, it is because I have four types of routers. I will first login into the routers at the first type check and then I will execute the different commands for different again by checking the router type. But I have shortened the code here.

    I have tried the show version command,it is also not getting stored into the array