in reply to Count elements in array ref

scalar is unnecessary due to context. This is an idiom I like.

my $data = data(); my $count = @{ $data || [] };

Replies are listed 'Best First'.
Re^2: Count elements in array ref
by Anonymous Monk on Mar 29, 2016 at 18:27 UTC
    Just got it, but you were faster, thank you!