lazyreader has asked for the wisdom of the Perl Monks concerning the following question:

I am executing some command and permitting some action based on the command output match. I am using Net::Telnet package's method "cmd",
@cmdResults = $self->{conn}->cmd("my command goes here");
and output of the above execution appears in three consecutive linux prompts as follows say
linux:~>output string 1 linux:~>output string 2 linux:~>output string 3
and so on... Thus the array shall get only the first output, but I need to perform some match operation on either of 2nd or 3rd output. How shall I achieve the above?

Replies are listed 'Best First'.
Re: Problem in parsing command output
by zentara (Cardinal) on Feb 04, 2010 at 13:44 UTC
    Have you tried printing @cmdResults? Just to see what is in there?
    print join "\n", @cmdResults;

    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku