in reply to creating a Tk popup menu from a file

You are describing a scoping problem, like this
#!/usr/bin/perl -- use strict; use warnings; my @manu = ( 'Capitol', 'Columbia', 'Edison', 'RCA Victor', 'Victrola', ); my %call; ##################### TEST THESE $odd one by one our $odd = $manu[-1]; #our $odd; #my $odd; #my $odd = $manu[-1]; for $odd(@manu){ $call{$odd} = sub { print "you selected $odd\n" }; } for my $man ( @manu ){ my $f = $call{$man}; $f->() if $f; } print "$odd\n"; __END__ you selected Victrola you selected Victrola you selected Victrola you selected Victrola you selected Victrola Victrola
Tcl might be similar