Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Perl Monk, Perl Meditation
 
PerlMonks  

Re^6: Clearing anonymous Tk widgets

by Anonymous Monk
on Sep 03, 2012 at 07:08 UTC ( #991371=note: print w/ replies, xml ) Need Help??


in reply to Re^5: Clearing anonymous Tk widgets
in thread Clearing anonymous Tk widgets

Here is a simpler example

#!/usr/bin/perl -- use strict; use warnings; my @closures ; for( 1 .. 3 ){ my $me = $_; # lexical $me push @closures, sub { print "You got $me\n"; # lexical $me }; } $_->() for @closures; shift(@closures)->(); $_->() for @closures; __END__ You got 1 You got 2 You got 3 You got 1 You got 2 You got 3
See also Tutorials: Variable Scoping in Perl: the basics, Coping with Scoping , Mini-Tutorial: Perl's Memory Management, Lexical scoping like a fox


Comment on Re^6: Clearing anonymous Tk widgets
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2014-04-19 18:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (483 votes), past polls