I thought I got it to work but it seems it still errors out.
This is the code I'm using to connect where the sub routine catchError is user defined:
my $scpe = Net::SCP::Expect->new(host=>"$import_host",user=>"$import_user",password=>"$import_pwd",auto_yes=>1) or $scp_err=1...