in reply to edit remote files

or just create/edit the file locally on the same machine as your perl script, and ftp over using Net::FTP