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


in reply to Re^2: How's your Perl? (II)
in thread How's your Perl? (II)

Fair enough. My only excuse is that 5.8.3 is the only version I have, and that the other way seemed too similar to one of the solutions from last time around so I wanted to try something different :) I was trying to use the fact that $foo[-1] is the last element in the array, so if the array only has one element ...