# Your normal code goes here if (open(SESAME, "-|")) { # parent process $ftp->put( \*SESAME ,"ftptest"); $ftp->quit; } else { # child process does all the printing print STDOUT "Whatever you like to print"; exit; }