From looking at the scp and the ssh man pages - you get it via your shell by typing man 1 scp
there is the hint that the -f option does not ask for passwords (and also leaves no ssh window open). scp has the -o command line option that allows to deliver options to ssh. So you have to try that. If you don't have success with that, you could try either open scp for writing and try to write the password to scp, but I've never done this myself. The thing I'd try would be
open SCP, "| scp -o -l $filename $user\@$host:$target";
print SCP, $password;
# now pray that scp does its magic ...
|