in reply to Remote server file access issue

As Sidhekin and I have pointed out, you were trying to feed perl commands into ksh. Don't do that, it chokes. Wrapping perl commands into ksh syntax is tedious, so you would it find nice to talk directly to perl, I guess. Here's a small script that does the trick. perl will read one line from STDIN at a time, eval it and print a prompt:
#!/usr/bin/perl $| = 1; # make output unbuffered prompt(); while(<STDIN>) { # read 1 line... eval $_; # ...doit... warn $@ if $@; # ...complain if error prompt(); # ...and print prompt; } sub prompt { print "\n;# perl > " } __END__

Place that script in your home directory on the remote server, and call perl to execute it:

$telnet->cmd('perl perlshell.pl');
Now you can talk to perl.
print $telnet->cmd('print scalar localtime(time)'); Thu Jun 29 15:58:52 2006 print $telnet->cmd('print $^X'); /usr/bin/perl
Note that to logout you have to $telnet->cmd('exit') twice, one time to terminate perl, the next to terminate your login shell.

update: One exit alone leaves you again at the ksh prompt. Note also that you cannot issue multiline statements, as the remote perl interpreter reads one line at a time.

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}