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

Re: [MacPerl] MacPerl warn and die format




Andrew M. Langmead wrote:

> Since I was also someone who was arguing for retaining the MPW style
> die format, I should also mention that I'm perfectly willing to have
> it change to the standard form.
> 
> I still want the MPW style die messages, but I figure I'm willing to
> make a module that traps die() messages and reformats the error. Once
> thats done and put in my PERL5OPTS, perl will still act like an MPW
> tool to me. Modules that also trap die() will see standard format perl
> error messages, and everyone else will be happy. (and everyone who
> things that MPW is a pseudo-Unix environment can continue their
> delusion.)

FWIW There is an analogous situation in the port of perl to VMS.  
On that system all programming languages (including perl until relatively 
recently) call the moral equivalent of 

     exit(1);

in order to indicate normal successful completion of the program.  In all 
those other VMS languages C<exit(0);> indicates an "informational" exit 
that can be used to convey meaning to the outer process.

In Charles Bailey's original port the mapping was simple: exit($n); in VMS
perl mapped directly to C's exit(n); and someone familiar with the
"call exit(1) on vms when you would call exit(0) on UNIX" rule had no 
trouble.  That created an obvious mismatch in scripts intended for VMS 
and non-VMS systems and Larry Wall requested that the port be changed.  
It was so changed but the cahnge also included was a F<vmsish.pm> pragma
that enables you to put a statement:

   use vmsish;

at the top of your old VMS perl scripts and continue calling C<exit(1);> to
indicate normal successful completion of your script.  Without the C<use> of 
that pragmatic module a perl call to C<exit(1);> now maps to a C call to 
C<exit(44);> and a perl call to C<exit(0);> maps to a C call to C<exit(1);> 
on VMS.

In other words, the default behaviour allows for portability, but
the special behavior of the native convention is still accesible to
the diehard VMSer.  Since not everyone who uses MacPerl even has MPW
installed I'd suggest a similar approach be taken with the Mac port.

Peter Prymmer


***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch