By the way, a better alternative to the most important line from the programs I sent you can be written more clearly:
$hash{$current_function}->(); respectively: $current_function->(); ... if you don't like too many braces. :-) Octavian----- Original Message ----- From: <james.homme@xxxxxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx> Sent: Monday, December 08, 2008 6:13 PM Subject: Perl : Question About Performing Subroutines
Hi, The first thing I want to know is this. Is there a way to make a self-executable Perl program that I can just give to someone and they can run it without needing to install the Perl interpreter? The second thing is this. Can I do this. Can I have a hash whose keys are a set of values and whose values are the functions in my program I want to perform. For example, I don't want to say if key is this, perform this function, elseif key is this, perform that function. I simply want to look up a key and perform whatever function is in the value for that entry in the hash. Can I do this? If so, how? Thanks. Jim James D Homme, Usability Engineering, Highmark Inc., james.homme@xxxxxxxxxxxx, 412-544-1810 "The difference between those who get what they wish for and those who don't is action. Therefore, every action you take is a complete success,regardless of the results." -- Jerrold Mundis Highmark internal only: For usability and accessibility:http://highwire.highmark.com/sites/iwov/hwt093/
__________View the list's information and change your settings at //www.freelists.org/list/programmingblind