in reply to Re: multiple keys - one value
in thread using a hash of functions

OK I answered my own question based on one of my old writeups. It IS possible to eliminate the temporary variable by coding as follows:
use strict; my %h; #Pre-declare so it can be referenced inside populating code %h=( HELP => sub {print qq(help\n)}, '?'=>sub{$h{HELP}()}, SAVE=>sub{print qq(save\n)}, EXIT=>sub{$h{SAVE}()} ); $h{'?'}(); $h{EXIT}();
This prints the lines:
help
save