Don't ask to ask, just ask | |
PerlMonks |
Re: Perl die after executing external programby mr_mischief (Monsignor) |
on Apr 28, 2011 at 20:11 UTC ( [id://901867]=note: print w/replies, xml ) | Need Help?? |
Backticks don't capture STDERR. You'd need to redirect STDERR on top of STDOUT for lftp as lftp uses STDERR for much of its interface. Try this:
I make no guarantees, but I did install lftp just to test this theory and look at this which shows STDERR being used:
As a side note, I hope you're using SFTP or HTTPS (both of which modern versions of lftp support) if you're not using an anonymous connection. I don't use plain-text FTP with authenticated accounts, and I recommend others don't. Without getting into too many specifics about statistics, let's say it's common in the security department of a web hosting company to deal with customers whose hosting account credentials were stolen by malware or sniffing. It may be a small portion of customers who ever have a breach, but compromised passwords are a fairly common sort of breach. Use SFTP or scp if you can, and use HTTPS when possible if logging into a web app you actually care a lot about. BTW, none of this is really Perl-specific beyond 'Backticks don't capture STDERR.'. Then again, those backticks are reminiscent of shell backticks which work the same way, so that's not even that Perl-specific.
In Section
Seekers of Perl Wisdom
|
|