[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Perl tool status/result/exit code always zero?



At 2:34 -0400 1999.10.13, Joshua Juran wrote:
>Is it just me, or does the MPW Perl tool always return zero status?  I'd
>like to know if my script returned a failure code or died.
>
>Please shoot me discreetly if this is a FAQ.

It returns whatever you exit with.

  #!perl -wl
  `perl -e 'exit 0'`;
  print $?;
  `perl -e 'exit 1'`;
  print $?;
  `perl -e 'exit 2'`;
  print $?;

Returns:

  0
  1
  2

$? is the status variable.  Were you checking something else?

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org