Darren Birkett wrote:

OK, to be more specific, I'm using Net::Telnet:Cisco. When logged onto a device I'm using the "show version" command, and storing the output in an array. Each element of the array will therefore contain lots of rubbish. I just want to match certain keyword(s) to determine device type. I guess a for loop is the closest I'm going to get. I just thought there would be a specific function for this.
So then I wonder - which is more efficient. My earlier "join" example, or a for loop?

Ok, perhaps you need something like this:

my @output = grep /keyword1|keyword2/, $session->cmd('show version');


John -- use Perl; program fulfillment

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to