http://www.perlmonks.org?node_id=11138336


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);
Bill