in reply to (Ovid) Re(2): ref, no, maybe?
in thread ref, no, maybe?
I remember something in a project I was involved in in the distant past that made use of data structures a little like this:
Or maybe it was:$struct = { key => { sub_key => 'value', sub_key2 => 'value2', }, key2 => 'other_value', };
I don't fully remember the rationale for building a data structure like that, but I think it had something to do with decision-making, where if you'd come across a reference, only one of the references would be used, with control passing off to the next item when it was completed (something like that). I just remember that it required us to use 'ref' when processing it, and perhaps a bit of recursion. I'm perfectly willing to accept that this is bad practice, and I've learned a lot of Perl between then and now and it's likely that I might have come up with alternative way to accomplish what we were doing... *shrug*.@items = ( 'item1', [ 'nested1', 'nested2', 'nested3' ], [ 'nested4', [ 'nested5', 'nested5a' ] ], 'item6', 'item7', [ 'nested8', 'nested9' ], );
|
---|