my $out=''; for (0..1000) { $out .= "$_"." bottles of beer on the wall\n"; } print $out;