Hi,
On Do. 31. Aug. 2006, 05:54:10, zlr wrote:
Show quoted text> Using : Perl Packager, version 0.12 (PAR version 0.952)
> Activestate perl 5.8.0 on XP SP2
>
> Compile the following code with pp :
>
> use strict ;
> use warnings ;
> use Win32 ;
>
> $SIG{ __DIE__ } = sub {Win32::MsgBox ("Error : @_ " , 0, $0 ) } ;
>
> die "ARRG" ;
>
> The resulting exe will produce 4 message windows instead of a single
one .
I could verify that. I'm not sure why this happens and I fear I'm
unlikely to find out. I'll send a CC to the par@perl.org list where a
couple of people hang out who know PAR's quirks better than I do.
If you add an exit($CODE) to the SIG handler, you'll only get a single
error message box. Perhaps that's already enough.
---
use strict ;
use warnings ;
use Win32 ;
$SIG{ __DIE__ } = sub { Win32::MsgBox ("Error : @_ " , 0, $0 ); exit(1); } ;
die "ARRG" ;
---
The four windows appearing might be related to how PAR runs your program
from a binary. It unpacks to a temp dir and runs script/main.pl from the
archive. main.pl then runs script/whatever.pl. The Perl intepreter used
is the same as the one compiled into parl.exe or used from a shared
library. All of these nested executions might somehow throw die() in a
cascade because $SIG{__DIE__} is overridden. This is supported by the
fact that putting an exit(1) into the handler "fixes" the issue.
I doubt PAR can do a lot about this conceptually without rethinking and
rewriting a lot of the packaging code.
Hope this helps,
Steffen