You can't pass the FTP object in any meaningful way. Your only option is to run a perl server locally that maintains the ftp connect and listens for some other type of connections. Then your text editor can talk to that server and that server can use the ftp connection. It will be faster than opening a ftp connection every time, mostly.