#!perl use strict; my $counter = 0; sub print_next_counter { print $counter++; }; while ($counter < 20) { print_next_counter(); print "----\n"; }