Personally, I just pass around a reference to the complex data structure. And to keep it all dead simple, I declare the complex data structure as a reference to start with. That way there are no extra copies being made passing around the data structure is exactly the same as using it, and I don't fall out of practice with dereferencing.
It is indeed a bit of a climb, but once you get around to figuring out references, everything becomes easier :)
In reply to Re^3: Teaching Perl
by SuicideJunkie
in thread Teaching Perl
by ambrus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |