in reply to Saving data to file

Why not
my @data = (1,0,1,2,3,4,5,6,7,8,9,11,2,2,3,34,5,6,7,8,81);
and then
for (0 ... $#data) { output($data[$_]);
or even
for $element (@data) { output($element); }
Update: Sorry for posting untested code - of course, that should read formy $element ...
my bad (pun not intended, but appropriate)