in reply to ftp put without a local file

$ftp->put( <SESAME> ,"ftptest"); print SESAME "This is a test.\n";
The filehandle has to be a file handle ready to read from. The $ftp->put will block until it is done reading, so you'll never get to the print that way. And you would say '\*SESAME' NOT '<SESAME>'. You might try Hofmator's suggestion (with the aforementioned fix), or try a socketpair or pipe if you don't want to tie up STDOUT.

Another suggestion is to use an IO::Scalar handle if all the data you're sending will fit in memory.