May 17, 2002, 8:37 AM
Post #2 of 3
Re: [n_kabourakis] Net::Telnet. Open, Edit, Save REMOTE file. Is it Possible?
[In reply to]
I have not done this, but after reviewing the information on the module, it seems
that you could use the cmd method to execute any command that you can
execute from a normal telnet command line and get the output returned to your
script. This said, I think you could use 'cat' to get the contents of the file and
store it in a variable to be edited. The problem with this is that putting the
contents of your edits back into that file would not be very easy. Another
possible solution is to use awk or sed commands through this cmd method. Or is
it possible that you could create a shell script to perform on the files on the fly
to make the edits on the machines that the files are located.
Sorry if this was not much help. Again, I just thought maybe some ideas might
generate a spark of an idea to fix your dilemma.
print unpack"u*",pack "h*",$a,"\n\n";