in reply to calling a unix prog

I think Fastolfe has the solution to your problem, but I'd just like to emphasize that backticks are rather expensive, as perl goes to a lot of trouble to gather the output of the command it spawns in the subshell. Consider using system instead, and check to see that the calls succeed. system is a little odd, in that it returns 0 (which in Perl, is a false value) on success, so your system calls should look like:

system("foo") && die "Couldn't execute foo:$!";

Instead of the usual or die

Philosophy can be made out of anything. Or less -- Jerry A. Fodor

Replies are listed 'Best First'.
RE: Re: calling a unix prog
by runrig (Abbot) on Nov 07, 2000 at 02:58 UTC
    As pointed out earlier in some other thread, $! will not provide any helpful message on errors from system() or backticks. You will usually get a system error message which has no relation to $! echoed to STDERR though, and the rest of your die message will print with the line number.