anu wrote:Why? Telnet is not a file transfer proticol. Why not use a module> I am tryin to copy a tar file from remote machine to local machine
> using Net:Telnet.
that *does* interface with a file transfer proticol? Such as Net::FTP
"doesn't work" is the worst of all possible error descriptions. What> I am using the following logic :
> my(Out) = $objTelnet->cmd("cat $FromFile");
> $strArg2 = basename $FromFile if $strArg2 eq '.';
> open (FH, ">$strfnArg2") or die "Can't open $strfnArg2 for
> writing: $!";
> print FH Out;
> #closing local file
> close FH or die "Can't close $strfnArg2 : $!";
> print ("File fetched from remote host successfully");
> Note: here strArg2 is the filename that is passed as an argument.
> This logic is working fine for ascii files but doesnt for tar
happens? Syntax error? Run-time error? Empty file? No file?
How can we help you when you won't tell us what goes wrong?
I don't know what that means.> "cat file.tar" i dont know if that is fine.
Nothing I saw in my (very brief) examination of the docs suggests that> And also please do clarify this doubt of mine----" Can we open a
> filehandle for a file on the remote machine using Net::Telnet " if so
you can. However, check out Net::SSH, which does seem to have that