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


in reply to Re: Printing an array using while loop
in thread Printing an array using while loop

In addition to using a "last" in a while loop - which is not good practice, this solution goes against the spirit of the OP's question.