Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Net::Telnet in a foreach loop

Reply
Thread Tools

Net::Telnet in a foreach loop

 
 
HC
Guest
Posts: n/a
 
      04-13-2005
Hi all,

I wrote a script and I can nog get the errmode to work right but before I
start asking questions on the errmode problem I wanted to ask another
question first.

When doing a script using Net::Telnet to telnet to several hosts where would
the $obj = Net::Telnet->new( ) be placed in the foreach loop?

$obj = Net::Telnet->new( );
foreach $host (@hosts) {
$obj->open($host);
#do your login and cmd's here
}

OR

foreach $host (@hosts){
$obj = Net::Telnet->new( );
$obj->open($host);
#do loging and cmd's here
}

I asume that using the wrong method might be a reason for the errmode not to
work right. I am using the first method described right now...

Thanks for the help.

HC


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Triple nested loop python (While loop insde of for loop inside ofwhile loop) Isaac Won Python 9 03-04-2013 10:08 AM
loop througth Literials using foreach!! Islam Elkhayat ASP .Net 16 02-12-2005 01:51 AM
Problem with foreach loop =?Utf-8?B?SnVzdGlu?= ASP .Net 2 10-22-2004 08:35 AM
Re: foreach loop error Luc Kumps ASP .Net 0 08-22-2003 10:16 PM
Re: foreach loop error Kevin Spencer ASP .Net 0 08-22-2003 09:11 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57