2

@myArray is an array with one element. The element is an array with 20 elements.

@myArray->
        [0]-> 
             [0]
              .
              .
              .
              [19]

How do I get to the size (20) of the array inside the array?

1 Answer 1

4

Dereference the array:

use warnings;
use strict;

my @arr = [5..24];
print scalar @{ $arr[0] }, "\n";

Output:

20
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.