J.Shankar has asked for the wisdom of the Perl Monks concerning the following question:

How to perform read/write/open a file on remote Linux/Unix host using Net::Telnet? I’m unable to perform File I/O operations on remote host(Linux) while using Net::Telnet Perl module. Any assistance will be of really helpful for me to proceed further. Thanks, Shankar
  • Comment on How to perform read/write/open a file on remote Linux/Unix host using Net::Telnet?

Replies are listed 'Best First'.
Re: How to perform read/write/open a file on remote Linux/Unix host using Net::Telnet?
by kcott (Archbishop) on Sep 11, 2013 at 04:10 UTC

    G'day J.Shankar,

    Welcome to the monastery.

    The first place to look would be the Net::Telnet documentation. There's a lot of information there as well as many examples.

    If you subsequently run into problems, you can certainly ask here, but we'll need to know what you're having trouble with. You should explain your issue, provide code to show what you've already tried (or can't get to work), and provide us with any error or warning messages you receive. Guidelines for doing this can be found in "How do I post a question effectively?".

    -- Ken

Re: How to perform read/write/open a file on remote Linux/Unix host using Net::Telnet?
by roboticus (Chancellor) on Sep 11, 2013 at 10:36 UTC

    J.Shankar:

    The Net::Telnet module allows you to talk to a remote computer as if you were manipulating the keyboard. If you're determined to do it via Net::Telnet, then I'd propose coding up something that would send the commands you would use to manually edit the file.

    But it would be better if you came up with a better method, such as one of these:

    • Mount a share from the remote machine (via NFS, Samba, etc.).
    • Use Net::FTP to grab the file and edit locally.
    • Write a program to execute on the remote machine to perform the edits.

    ...roboticus

    When your only tool to edit a remote file is Net::Telnet, all problems are harder than they need to be.