Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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

by sundialsvc4 (Abbot)
on Nov 07, 2013 at 14:21 UTC ( #1061581=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

Hmmm... my understanding of the BEGIN block is that it is run at compile time, and that it is typically (only ...?) used to make changes that will affect the subsequent compilation.   So, do you really intend to use this for the purpose of constructing a window?   (There is also, iirc, an INIT block available, which occurs after compilation but before the run.)   Based on my (limited) understanding of the feature, I am surprised that you are trying to do, what you are trying to do, here.   And not too surprised that something as extreme as a core-dump might be the result.   It could well be that this code is attempting to touch things that are not fully initialized yet.   Perhaps this statement should be done elsewhere in the code?

(I was trying to stumble-upon the correct perldoc page ...)   Thank you... it’s perldoc perlmod.


Comment on Re: perl 5.16.3 + Tk 804.031 core dumps on syntax check when a window is made in BEGIN block
Re^2: perl 5.16.3 + Tk 804.031 core dumps on syntax check when a window is made in BEGIN block
by ohcamacj (Sexton) on Nov 08, 2013 at 21:49 UTC
    That would be perlmod. It's about halfway down the page, and states,
    The begincheck program makes it all clear, eventually:
    #!/usr/bin/perl # begincheck print " 8. Ordinary code runs at runtime.\n"; END { print "14. So this is the end of the tale.\n" } INIT { print " 5. INIT blocks run FIFO just before runtime.\n" } CHECK { print " 4. So this is the fourth line.\n" } print " 9. It runs in order, of course.\n"; BEGIN { print " 1. BEGIN blocks run FIFO during compilation.\n" } END { print "13. Read perlmod for the rest of the story.\n" } CHECK { print " 3. CHECK blocks run LIFO at compilation?s end.\n" } INIT { print " 6. Run this again, using Perl?s -c switch.\n" } print "10. This is anti-obfuscated code.\n"; END { print "12. END blocks run LIFO at quitting time.\n" } BEGIN { print " 2. So this line comes out second.\n" } INIT { print " 7. You?ll see the difference right away.\n" } print "11. It merely _looks_ like it should be confusing.\n" +;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2014-11-21 16:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (114 votes), past polls