Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Strange behavior of iteration while creating Perl/Tk widgets dynamically

by BillKSmith (Monsignor)
on Nov 02, 2021 at 15:23 UTC ( #11138336=note: print w/replies, xml ) Need Help??

in reply to Strange behavior of iteration while creating Perl/Tk widgets dynamically

My previous reply provides a solution to your 'overflowing' problem. The difference is in the scope of $i. I admit that the documentation does not make this clear although it does address it.
#for (my $i = 1; $i <= 5; $i++) { for my $i (1..5) {

However, your script still does not execute correctly. (Error when pressing any of the CLR buttons.) Symbolic references are almost always a poor design choice. They are error prone and very hard to debug. (Largely because you have given up the benefit of use strict but also because of their strange syntax.) Your error message points to the offending line. After correcting two symbolic error bugs in that line, your program runs without error. I have no idea if it does what you intend.

#$$clrCanvas -> itemconfigure(${$clrCanvasItem}, -fill => $color); $clrCanvas -> itemconfigure($clrCanvasItem, -fill => $color);

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2022-01-26 12:44 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (69 votes). Check out past polls.