----- Original Message -----
From: Jie Meng <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 10, 2001 5:02 PM
Subject: A simple question


Dear all,

I plan to write a simple remote connection script, and then "ls" the content
of the current directory, input like

telnet hostname
username
password
ls

I use the following script:

system ("telnet hostname");
<STDOUT> = "username\n";
<STDOUT> = "password\n";
system ("ls");

It failed in the <STDOUT> syntax.

Can anyone kindly give me a hint?

Yep.
STDOUT is a GLOB filehandle poiting to the standard output (e.g. console
window).
the <> operator tells to read a line.
So what you are saying is:

Read a line from standard out = "username\n";

That is nog gonna work.
Try this:

print STDOUT "username\n";.

Although i also agree with Craig's response that you would be better of
using standard perl modules that implement the desired functionality.

Maarten.

Reply via email to