This is because things are passed back and forth between subs in flattened lists - how does it no where to stop with an array, start with a scalar, and finish with another hash?my ($type, %results) = findResults(); #More code return ($type, %results);
As a side note - you should probably look into passing references around instead of full blown hashes and arrays if they are going to grow to any size. This accomplishes two things - everything is a scalar and there is no copying back and forth to speak of. Well three actually. The technique I showed only works if you have a bunch of scalars and then only one slurpy thing (array/hash). If you have multiple slurpy type thingies (love my technical jargon) - you have to use references.
Cheers - L~R
In reply to Re: Returning multiple values from a function
by Limbic~Region
in thread Returning multiple values from a function
by Grygonos
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |