Try this:

@lines = $telnet->cmd("dir");
print "$_\n" foreach @lines;

-Shawn

---- Original message ----
>Date: Fri, 22 Feb 2002 09:12:45 -0500
>From: "Eric Logeson" <[EMAIL PROTECTED]>  
>Subject: Net::Telnet  
>To: <[EMAIL PROTECTED]>
>
>The code below (thanks to Don Carlton)works, however the print "$line\n"; 
prints a "1" instead of the directory listing.  I would like to see the 
directory listing if possible.  I am using the built in win2k telnet server if 
that matters.
>
>use Net::Telnet;
>$user="user";
>$pass="password";
>$host="testmachine.com";
>$dumplog="dump.log";
>$inplog="input.log";
>$optlog="option.log";
>$outlog="output.log";
>$matchop='/c:/i';
>
>$telnet = new Net::Telnet(Dump_Log => $dumplog,
>                       Input_log => $inplog,
>                       Option_log => $optlog,
>                       Output_log => $outlog,
>                       Timeout => 4,
>                       Prompt => $matchop);
>$telnet->open($host);
>$telnet->login($user, $pass);
>$line = $telnet->cmd("dir");
>print "$line\n";
>$telnet->close;
>
>Thank you
>Eric
>_________________
>Eric Logeson
>919-680-5679
>www.dukece.com
>
>
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to