more useful options | |
PerlMonks |
Behaving appropriately based on ref() resultby qbxk (Friar) |
on Jan 08, 2006 at 14:33 UTC ( [id://521818]=perlquestion: print w/replies, xml ) | Need Help?? |
qbxk has asked for the wisdom of the Perl Monks concerning the following question:
Writing a function to traverse a "configuration" array I have a series of if/elsifs that switch based on what kind of data it encounters, ie. by whatever ref() returns.
here's an mini-example:
My question for the clergy is: what's a more elegant way to accomplish this? or what is your favorite idiom for this task? also, have i hit on all the possible values that ref() can return? It's not what you look like, when you're doin' what you’re doin'. It's what you’re doin' when you’re doin' what you look like you’re doin'! - Charles Wright & the Watts 103rd Street Rhythm Band
Back to
Seekers of Perl Wisdom
|
|