use strict; use warnings; my @array = ('a'); foreach (@array) { push @array,'a'; print"@array\n"; sleep(1); # so we can absorb what's happening }