in reply to Perl die after executing external program

What should $result contain? Is it possible that the return value is either '0', or an empty string (either of which would evaluate to false, triggering the die.)

Your writeup states that the external command is executing correctly (if I understand what you're saying). But if it weren't executing correctly I might ask if it's running with the same permissions you have.


Dave

Replies are listed 'Best First'.
Re^2: Perl die after executing external program
by aullah (Initiate) on Apr 28, 2011 at 20:29 UTC
    Yes, I'm using root account for executing this perl script.
      I see you replied to Re: Perl die after executing external program after I posted Re: Perl die after executing external program but did you bother to read what I typed? You're already capturing STDOUT of the process. You also need to capture STDERR, because that's where the output you want goes.

      Yes, it really is that simple. Differences in account permissions are always a relatively good guess about differences in how programs operate, but a good guess is still a guess. Which file descriptor lftp uses for output doesn't change depending on which account is running the program. Which one you need to capture does change depending on which one is being written to in the executed program.

      2>&1 is your friend.

        Yes, I did tried to capture the STDERR but nothing written there. Empty.