in reply to setenv system call
Here is a pure perl solution, that should work:
$ENV{RSYNC_PASSWORD} = $passwd; [download]