Someone had posted to a newsgroup about how to extract arrays from a hash. Not being a programmer by trade, but more by happenstance, I still feel sorry for those among us (like myself) who are not gurus. Anyway, I thought I'd take a crack at explaining it, since I was curious myself. I made myself a little hash of arrays of arrays, and pondering it meditatively, I thought to myself: if only scalars are stored in the symbol table, why can't I just use the scalar name of the first array in the first array to get at the values of that array (what a mouthful!).
It all seemed too easy, so I quickly finished up the script to test whether
would grab the values I wanted. I was so amazed I had to look it up in the camel book just to make sure I hadn't made a discovery that would rock the Perl community to its foundations (okay, just to make sure I was right).@extract = @{$hoa{'arrays'}[0]}
Anyway, that was the point at which referencing and dereferencing values suddenly made a whole lot more sense to me.
So beware Perl gurus, wherever you are; I'm on my way to the top!
matt
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 1: Things that make you go hmmm
by tilly (Archbishop) on Nov 01, 2001 at 17:59 UTC | |
by mattg (Novice) on Nov 01, 2001 at 22:25 UTC |