The third one is the problem: it's a very simple count of elements in the aforementioned temporary array. Like this: $count = @array;
That doesn't assign a reference to an array, it puts the length of the array @array into $count What you want (and are probably doing in your real code) is
$count = \@array;Other than that, I'd start by inspecting the value that actually ends up in $count to see what it contains. You can use the inbuilt ref function or Scalar::Util->reftype(). Also consider posting the real code you're using (since you've obviously made at least one mistake in transcribing/summarising it), it sould be particularly pertinent to know which "external module" returns the array reference.
In reply to Re: Return variable hangs script
by tirwhan
in thread Return variable hangs script
by joedoc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |