in reply to Re^4: Perl die after executing external program
in thread Perl die after executing external program
That's odd. This code works for me:
my $CLIENT = "lftp"; my $connectionString = "" . $CLIENT . " -d -f bar 2>&1"; my $result = `$connectionString` || die "\nERROR running $CLIENT: $!"; print $result;
The return won't work because this isn't part of a subroutine, but you should get an error about that specifically if this is really the code you're running and it ever makes it past the die. Also, my script file was called 'bar' rather than script.ftp in this case.
Are you sure lftp is in your path when the program is run? You might have to supply the full path.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Perl die after executing external program
by aullah (Initiate) on Apr 29, 2011 at 13:46 UTC | |
by mr_mischief (Monsignor) on Apr 29, 2011 at 17:26 UTC |