in reply to Re^2: Reversing a singly linked list
in thread Reversing a singly linked list

Because you always effectively assign next => $curr , hence it's always defined.

Try Data::Dumper to check if your data is what you think it should be.

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!