Think about Loose Coupling | |
PerlMonks |
Re^3: how to manage a large console menuby liverpole (Monsignor) |
on May 22, 2006 at 14:06 UTC ( [id://550937]=note: print w/replies, xml ) | Need Help?? |
Yes, that's a valid point. I considered using a hash in my example, but decided against it for the reason that, in this particular case, it's pretty easy to make the transformation from 'systemN' to 'hostname_to_systemN' for any value of N.
The potential downside to making it a hash is that you have to sacrifice keeping it in the order you like (unless order isn't important, or you don't mind just using the order which sort generates). Another option which lets you keep the order you prefer, and still have corresponding values for each of your "keys" would be to have both an array *and* a hash, eg.: which gives a nice flexibility, but requires making updates in two data structures rather than just one. The tradeoff one chooses will ultimately be a matter of personal preference and/or need. s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/
In Section
Seekers of Perl Wisdom
|
|