in reply to Re: printing array values
in thread printing array values

It does so along with some "use of uninitialized value" warnings, corresponding to the values 0, 6, 7, 8, 9 of $counter which are not valid keys in your example . (tested with perl 5.6)
Well, it would, had he included this line in his script:
use warnings;
Indeed this, and
use strict;
are the most important lines in most perl scripts!