in reply to perlref repeats last of array
I suspect that you have have an extra key to the "Memory" value. A diagnostic print keys %choices; will tell.
Do you realize you're using symbolic references to code? use strict; would have told you that. Here's one cure:
my %choices = ( 'File Systems' => \&fs_sub, 'Memory' => \&mem_sub ); for (keys %choices) { $choice_menu->command( -label => $_, -activebackground => '#CCCCCC', -command => $choices{$_}); }
Update: Your code from the reply works here without doubling the Memory line. So does the modified code I suggested. I wonder if Tk says no strict 'refs'; somewhere?
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: perlref repeats last of array
by Kickstart (Pilgrim) on Nov 26, 2001 at 12:21 UTC | |
by demerphq (Chancellor) on Nov 26, 2001 at 12:47 UTC |