XP is just a number | |
PerlMonks |
Re: ftp to sftp migration in perlby atcroft (Abbot) |
on Apr 21, 2016 at 19:48 UTC ( [id://1161150]=note: print w/replies, xml ) | Need Help?? |
I would suggest adding the following (at the top of your script) for debugging:
I would then run the code. The Carp::confess will (effectively) give you a full stack trace of calls when the die() occurred. You can then see where your script was when the error occurred. My hunch is that when your Net::SFTP connection failed and the program exited (error 1), error 2 was generated because the database handle was destroyed (forcing the rollback) with no disconnect. You may want to consider opening the database connection after you have the SSH/SFTP connection completed, using a signal handler to clean up the database handle if an error occurs, or change the way the database connection is created (although I doubt that one is what you want). Hope that helps.
In Section
Seekers of Perl Wisdom
|
|