I am getting the same problem that is being reported at URL
http://perlmonks.thepen.com/433411.html
with subject title
Problems with pp (Perl Packager)
I let them know I was here going to post a sample script that duplicates the problem.


I am getting the same message
     "BEGIN failed--compilation aborted at -e line 835"

I am using Mandrake Linux, perl 5.8.6 and par 0.87
It runs fine as a perl file.

There are two files below.
 test_tk_129.pl
      Invokes tk_utils to pop up a simple button.
      Prints hello.
 tk_utils.pm
      Pops up a "Click me" button and returns.
It runs fine using
   "perl test_tk_129.pl"
I do
   pp -o test_129 test_tk_129.pl
and then run
   ./test_129
and I get these results:
   main says hello
   _TK_EXIT_(129)
   BEGIN failed--compilation aborted at -e line 835.

---------------------------------Paste of test_tk_129.pl
#!/usr/local/bin/perl -w
use tk_utils;
tk_utils::debug_test_1;
print "main says hello\n";
exit(129);

-------------------------------End paste of test_tk_129.pl

-------------------------------Paste of tk_utils.pm
#!/usr/local/bin/perl -w
package tk_utils;
use Exporter;
@ISA = qw(Exporter);
@EXPORT = ( "debug_test_1" );

use Tk;
use strict;

sub okay_response {
 my ($we_top) = @_;
 $we_top->destroy;
}

sub debug_test_1 {
 my $okay_button;
 my $we_top = new MainWindow;

 $okay_button =
     $we_top->Button(  -text => "Click Me",
                       -command => [  \&okay_response,
                                      $we_top,
                                   ]
                     )->pack(-ipadx =>10);
 #########
 MainLoop;
 #########

}

------------------------------End paste of tk_utils.pm


----------------------------Paste of notes after further testing

I need to have an exit(129) statement in my real code, so I am keeping it in this little test. If I remove the exit(129) statement, THE PROBLEM GOES AWAY. If I have just "exit;" the problem comes back.

Again, my real code must be able to tell the caller that it has exited with an error code.

Thanks




Reply via email to