I'm not sure if this will work but you could try something like:



open( FM, "| fetchmail") ;
print FM "mypassword";
close(FM);


Another option would be to use the Expect::Simple module.