in reply to Syntax error using Tk

No problem. An array element is indexed like $button[$i] not $button{$i}. Curly braces are for hashes.

If you think you might be doing a lot of GUI programming, O'Reilly's "Mastering Perl/Tk" is a good reference on the subject that mentions a lot of things you wouldn't think about doing. It covers things like drawing on a Tk Canvas, icons, buttons, menus, and so on... It's a good book.