Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: append an expression to a file on remote host

by chennaiite (Sexton)
on Sep 01, 2005 at 05:31 UTC ( #488299=note: print w/ replies, xml ) Need Help??


in reply to Re: append an expression to a file on remote host
in thread append an expression to a file on remote host

Hi, If you have access to the remote machine you can use a simple open method.
you can go through this code and have some idea....
Authentication of the remote is also should be there....

$hostname ="testing";#it may be ip address or remote host name $hostfilename="temp\fooo.ini"; $hostfilename =~ s/\\/\\\\/g; my $file="\\\\$hostname\\$hostfilename"; if(!-f $remotepath){ print "Remote access and add content to remote file\t\Failed"; exit; } else{ #Remote file access open(TEMP,">>$file") or die ("cannot open the remote file '$fi +le':$!"); #Here add your stuff to append data to the remote file close(TEMP); }


Comment on Re^2: append an expression to a file on remote host
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (20)
As of 2015-07-28 13:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (255 votes), past polls