in reply to using a hash of functions
Wouldn't it be nice if there was some idiom (say, a magical
hash...) that would allow me to say:
$_="goto+F.print+chop;\n=yhpaj";F1:eval
Instead of%hash = ( HELP => sub { ... }, '?' => $_{HELP}, QUIT => sub { ... }, EXIT => $_{QUIT}, LEAVE => $_{QUIT}, );
%hash = ( HELP => sub { ... }, QUIT => sub { ... }, ); $hash{'?'} = $hash{HELP}; $hash{EXIT} = $hash{LEAVE} = $hash{QUIT};
$_="goto+F.print+chop;\n=yhpaj";F1:eval
|
---|
Replies are listed 'Best First'. | |
---|---|
RE: multiple keys - one value
by merlyn (Sage) on Sep 27, 2000 at 23:34 UTC | |
by japhy (Canon) on Sep 28, 2000 at 01:55 UTC | |
by bradcathey (Prior) on Dec 04, 2003 at 14:20 UTC | |
by merlyn (Sage) on Dec 04, 2003 at 21:17 UTC | |
by bradcathey (Prior) on Dec 05, 2003 at 02:14 UTC | |
by runrig (Abbot) on Dec 05, 2003 at 17:25 UTC | |
(jcwren) RE: multiple keys - one value
by jcwren (Prior) on Sep 27, 2000 at 21:56 UTC | |
Re: multiple keys - one value
by sandfly (Beadle) on Sep 11, 2003 at 22:14 UTC | |
by NetWallah (Canon) on Dec 04, 2003 at 06:39 UTC | |
by QM (Parson) on Dec 04, 2003 at 07:10 UTC | |
by NetWallah (Canon) on Dec 05, 2003 at 05:58 UTC |
In Section
Seekers of Perl Wisdom