in reply to Re: STDIN method?
in thread STDIN method?
..Obviously for just picking what to print, you're making work for yourself, but if you need to accomplish more than that (which is usually the case), it can save time (without a million elsifs cluttering your code).$hash{1} = sub {print "You chose turkey";}; $hash{2} = sub {print "You chose Goat;"; print "..ew";}; for (keys %hash) { &{$hash{$_}}; }
|
|---|