Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

edit remote files

by Anonymous Monk
on Sep 04, 2006 at 07:08 UTC ( #571019=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Replies are listed 'Best First'.
Re: edit remote files
by davido (Cardinal) on Sep 04, 2006 at 07:20 UTC

    Quick solutions will be more forthcoming for questions composed to include the details vital to our coming up with a solution.

    Where is the remote script? What method do you intend to use to access it? There's simply not enough detail in your question to make it answerable.


    Dave

      You can also use RPCs like SOAP::Lite for executing a remote subfunction and write the file modification script in that subfunction.
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: edit remote files
by RobPayne (Chaplain) on Sep 04, 2006 at 18:28 UTC
    The number of replies going in different directions seems to indicate that you should take a look at How (Not) To Ask A Question and How do I post a question effectively?.

    There are any number of answers to your question, depending upon the requirements that you have and what you are already doing in your script. You could create the file locally, and copy it to the remote machine using ftp, sftp, or scp. You could open a port just for this, accepting the remote file via this port, and then feed the new file contents back over the port to the connecting/authenticating machine. You could copy the remote file to a local temp file, and run some checks/edits of it's contents and then copy it back, or any of the other suggestions that you have received.

    Personally, I tend to favor using an existing protocol, such as scp or rsync plus ssh. Whether you just copy a standard file to the remote machine mostly depends upon whether these files are going to have/need local changes made to them.
Re: edit remote files
by johnnywang (Priest) on Sep 04, 2006 at 15:47 UTC
    or just create/edit the file locally on the same machine as your perl script, and ftp over using Net::FTP

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://571019]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2021-03-02 05:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favorite kind of desktop background is:











    Results (36 votes). Check out past polls.

    Notices?