Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: perl 5.16.3 + Tk 804.031 core dumps on syntax check when a window is made in BEGIN block

by LanX (Canon)
on Nov 07, 2013 at 00:04 UTC ( #1061503=note: print w/ replies, xml ) Need Help??


in reply to perl 5.16.3 + Tk 804.031 core dumps on syntax check when a window is made in BEGIN block

Can't reproduce it, but what happens if you put the use Tk within the BEGIN-block?

Cheers Rolf

( addicted to the Perl Programming Language)


Comment on Re: perl 5.16.3 + Tk 804.031 core dumps on syntax check when a window is made in BEGIN block
Download Code
Re^2: perl 5.16.3 + Tk 804.031 core dumps on syntax check when a window is made in BEGIN block
by choroba (Abbot) on Nov 07, 2013 at 00:11 UTC
    No change.
    لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
Re^2: perl 5.16.3 + Tk 804.031 core dumps on syntax check when a window is made in BEGIN block
by Anonymous Monk on Nov 07, 2013 at 00:37 UTC

    Earlier use Tk; was already in BEGIN block before the genesis of above test case.

    Moving destroy() inside BEGIN does avoid the core dump. Need to have, however, the MainWindow object to live beyond BEGIN block for other things.

    # Remove "BEGIN" and get no core dump. BEGIN { use Tk; our $MW = MainWindow->new(); # other method calls. } our $MW; # more changes to the window. # Being here does not avoid core dump. $MW->destroy();
    c

      BEGIN { use Tk; our $MW = MainWindow->new(); # other method calls. } our $MW;

      Perhaps you mean (not verified):

      our $MW; BEGIN { use Tk; $MW = MainWindow->new(); # other method calls. }
      Declare the window before the BEGIN block, and assign it within the BEGIN block. Update: I stand corrected.

      --MidLifeXis

        # cat x.pl ; perl-5.16.2 x.pl use strict; use warnings FATAL => 'all'; use 5.010; P::show(); Q::show(); R::show(); {{ package P; my $v = __PACKAGE__; BEGIN { $v .= ' ' . __LINE__; } sub show { say $v; } }} {{ package Q; our $v = __PACKAGE__; BEGIN { $v .= ' ' . __LINE__; } sub show { say $v; } }} {{ package R; BEGIN { our $v = __PACKAGE__ . ' ' . __LINE__; } our $v; sub show { say $v; } }} __END__ 13 21 R 28

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1061503]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2014-12-20 04:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (95 votes), past polls