use warnings; use strict; use feature qw/say /; my @test_array = ([1, 2, 3], [4, 5, 6]); test_function(\@test_array); sub test_function { my ($ref_array) = @_; say scalar @$ref_array; }