Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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

by MidLifeXis (Prior)
on Nov 07, 2013 at 15:09 UTC ( #1061597=note: print w/ replies, xml ) Need Help??


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

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


Comment on Re^3: perl 5.16.3 + Tk 804.031 core dumps on syntax check when a window is made in BEGIN block
Select or Download Code
Re^4: 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 09, 2013 at 12:02 UTC
    # 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://1061597]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (17)
As of 2014-09-17 17:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (92 votes), past polls