All three give the same result if we modify the second one a bit:
my @arr = (2, 4, 8, 10);
print "First result:\n";
print scalar @arr;
print "\n\nSecond result:\n";
print $#arr + 1; # Shift numeration with +1 as it shows last index that starts with 0.
print "\n\nThird result:\n";
my $arrSize = @arr;
print $arrSize;