Hi richie,
Just to expand briefly on what tybalt89 mentioned: In Perl, closures like "sub {$fname = "$_"; &Restart}" in your code only "close over" lexicals (defined with my), and not global/package variables, that is those defined with our, or many of the special variables. $_ is one of those special variables that is a global. Whenever sub {$fname = "$_"} is executed, it will access the current value of $_.
Hope this helps,
-- Hauke D
In reply to Re: Perl/Tk menu and commands based on array
by haukex
in thread Perl/Tk menu and commands based on array
by richie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |