I guess you could always dereference the array then find its size.


my(@sample, $ref, @de_ref);

# Original array.
@sample = ('sample', 'sample');

# Make reference to original array.
$ref = [EMAIL PROTECTED];

# De-reference the original array.
@de_ref = @$ref;

# Get the size from the reference.
print ("The array's size is " . @de_ref . "!\n");

There is probably a better way, but I'm a newb so I don't know.

Cheers,
Adam

On Apr 6, 2004, at 7:40 PM, Andrew Gaffney wrote:

I've got an array reference and I'm trying to figure out how many elements are in it. I've tried '$#arrayref', '[EMAIL PROTECTED]', '$(@($arrayref))', and probably a few others that I've forgotten. What is the correct way to do this?

--
Andrew Gaffney
Network Administrator
Skyline Aeronautics, LLC.
636-357-1548


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to