Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

net::telnet match statement

Status
Not open for further replies.

labnotes

Technical User
Sep 1, 2003
33
CA
Good morning
I am working on a perl telnet script using module "net::telnet" and have multiple and different matches e.g:

sub Telnet_Wait
{
my $timeout = shift;
my ($before,$match) = ();

($before,$match) = $telnet->waitfor( timeout => $timeout,
match => '/OK/',
match => '/BUSY/',
match => '/NO CARRIER/',
);

return($before, $match);
}
The next call to this function may have more or less possible matches, can I make my match statement flexible?

Thank you inadvance



 
if I remember correctly, you can use regex when using the -match => '/OK|BUSY|NO CARRIER/i'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top