http://www.perlmonks.org?node_id=1010791


in reply to Palindrome array

"...Why does the first code work, but not the second one? Can you help me understand..."

using this

if (@array eq (reverse scalar @array)){..
gives the result you want on the second one.
Does that help or solve the puzzle by any means?

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me