in reply to Problem calling one script from another

Put $! in your exit error message and you will almost certainly be told exactly what your problem is. In fact I would take a tip from perlstyle and write it like this:
my $cmd = "perl /path/to/indexer.pl"; system($cmd) or die "Cannot run '$cmd': $!";
(Unless of course I took a tip from my understanding of Perl and arranged to do or require the script. Actually I would probably put it's functions into a module then use that.)

UPDATE
Oops.

The code snippet as written is useless. See comments below and the fact that the return for success is 0.

But the reference to perlstyle is good, as well the advice on not doing system commands is likewise.

Replies are listed 'Best First'.
Re: Re (tilly) 1: Problem calling one script from another
by chipmunk (Parson) on Dec 11, 2000 at 10:23 UTC
    Unfortunately, system() and backticks don't set $!. They do set $?, however, with the exit status << 8 or'ed with the signal that terminated the subprocess, if any. Here's an example from system on checking the value of $?:
    You can check all the failure possibilities by inspecting $? like this: $exit_value = $? >> 8; $signal_num = $? & 127; $dumped_core = $? & 128;
      Oops.

      That is why I test code before I put it into production.

      (As you can see I really do take my advice about modules. And I don't often use system. But I should have known better on that one. Well I did but forgot.)