Bob, Thanks for the help but again your failing to understand.
The perl script it self will use Net::Telnet with the script I run on this laptop that will be connected to a network. The perl module Net::Telnet will issue the telnet session Within the perl script. Gary Stainburn was closer to what I was trying to obtain with The perl script. my $telnet = Net::Telnet->new(HOST => $ipaddr); $telnet->login(USER,$PASS); # Get the host name of system # my @lines = $telnet->cmd($HOSTCMD); my $csv = Text::CSV->new; if ( $csv->parse(@lines) ){ my @field = $csv->fields; for $host (@field){ print OUT_FH $host,",", $ipaddr; print "Found Host...\n"; } } Without looping the above perl script works. The variable $HOSTCMD would be in this case the $HOSTCMD is uname -n that much of it works ok. But I think Gary has pointed out something for me to look at. Phillip -----Original Message----- From: Rob Dixon [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 28, 2003 8:44 AM To: [EMAIL PROTECTED] Subject: Re: Issue <[EMAIL PROTECTED]> wrote: > > Rob Dixon wrote: > > > > Bob Showalter wrote: > > > > > > This sounds fine in principle. Many of the standard Perl > > > modules do this kind of thing. You use the built-in $^O > > > variable to detect the operating system. If you want to > > > see > > > an example, do 'perldoc -m Cwd' to browse the source code > > > of the Cwd module. > > > > > > Instead of command_header.pl, consider making a > > > full-fledged module. It isn't hard. Start by reading > > > 'perldoc perlmod'. > > > > > > Also, read 'perldoc perlport' for general info on writing > > > cross-platform perl. > > > > The $^O variable indicates the platform on which the > > currently executing version of perl was built. If you're > > running Perl on a different platform from the one where it > > was built then I don't think it's likely to work too well! > > Does anybody know different? > > I appreciate your feed back but you clearly don't understand. > > The perl script I'll be running will be executed only from one > Location and that is from my laptop. I'll be connected to a > network In which the script will be using Net::Telnet module > to communicate To the other systems. No need to put any > scripts on any other machine Period!!!! > > So the $^O variable will only work if you run A PERL SCRIPT on > that System. The purpose of the script is to discover what > systems are on A given network. > > Again I don't need to run perl on multiple machines. That will > totally Defeat the purpose of the scripts. If you don't know > about CPAN then Look at http://www.cpan.org. That is where I > got the Net::Telnet module from. I know that Bob knows about the CPAN. He will also know about the 'Net::Telnet' module that you're using. What both he and I 'clearly' didn't understand was that you were using it: you make no mention of it in your original post. If you are running 'A PERL SCRIPT' on a machine that somehow has remote access to an external system, and your question is about that external system, then surely it makes sense to explain the mechanism of that access? Your answer, at this stage, is to open an interactive telnet session on your laptop to any one of your remote systems. If you can establish the type of that system from the session then you can do the same thing from Perl. Let us know if you need any more help. Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]