say @{$ref}->[0];
This raises a deprecation warning for me. say @{$ref}[0];
This is technically correct, as the leading sigil "@" indicates you are returning an array, but since you're only returning one element in that array, this should probably be "${$ref}[0]" which returns a scalar only. say $ref->[0];
This the only form which I would consider correct or "clean".This example proves nothing about Perl's power, though. The fact that difficult and fiddly reference handling shenanigans are necessary to handle something as trivial as nested arrays and hashes shows quite the opposite.
It's perfectly fine to use the array sigil, in which case it's a one-element list instead of a scalar. That's useful sometimes.
Compared to what? C? In what way is it more powerful than Ruby, Python, Ocaml, Haskell, etc.?
There are things perl has over e.g. python (lambdas) but there are at least as many things those languages have over perl (e.g. python generators built in) and all of those languages are easier to use. Look at the code you wrote there! I assume "use v5.10" is actually a forward compatibility declaration instead of a backward one, right? Really embarrassing if so.