I have a perl script that I am using to upload files to multiple servers. I wanted to move the subroutines out to a different file so I could use them in multiple scripts ( so i have script.pl and script.pm ), but this subroutine is not working whenever I call if from the outside file ( script.pm ) via require. If I leave the subroutine in the script file it works fine. Seems like it could have something to do with the array reference.
Code:
sub ivrSendVox($$$\@) {
($ftp,$lang,$ivr,$rvoxlist) = @_;
$ftp->cwd("$voxdir");
foreach $vox (@$rvoxlist) {
if($ftp->ls($vox)) {
renameVox($ivr,$vox);
$mail = 1;
} else {
$ftp->put("$vox");
$mail = 0;
}
}
$ftp->quit;
return $mail;
}
And I call the subroutine like this:
Code:
ivrSendVox($ftp,$lang,$ivr,@voxlist);
Thanks for any help.