in reply to Return variable hangs script
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Return variable hangs script
by joedoc (Initiate) on Jul 03, 2007 at 14:04 UTC |