XP is just a number | |
PerlMonks |
Hash option/menu loop wierd or usefull?by mulander (Monk) |
on Dec 07, 2005 at 17:16 UTC ( [id://514908]=perlmeditation: print w/replies, xml ) | Need Help?? |
Hellow fellow Monks, I recently came up with a really weird way to use perl's hashes. Maybe someone tried it before and found it usefull or maybe I just came up with the most usless thing ever ;) Here is the example code: I thought of it as a method to avoid a really long list of if-elsif-elsif-elsif-elsif-else chain, and as Perlmonks is full of people that understand perl much better than I do so I decided to contribute this idea, and would really like to know your honest opinions on such a weird hash usage. Here are the questions: a) Is it worth using? b) Is this will be taken as a 'bad style' example? c) Is if-elsif-elsif-elsif-else chain more efficient than this? Thank you all for taking the time to read this node. Regards, Mulander
Back to
Meditations
|
|