#!/usr/bin/perl use strict; use warnings; print "Test 4:"; foreach $_ (0 .. 5) { print join("\n", (("hello[$_]") x $_)), "\n\n"; } print "Test 5:"; foreach $_ (0 .. 5) { print join("\n", ("hello[$_]" x $_)), "\n"; } #### Test 4: hello[1] hello[2] hello[2] hello[3] hello[3] hello[3] hello[4] hello[4] hello[4] hello[4] hello[5] hello[5] hello[5] hello[5] hello[5] Test 5: hello[1] hello[2]hello[2] hello[3]hello[3]hello[3] hello[4]hello[4]hello[4]hello[4] hello[5]hello[5]hello[5]hello[5]hello[5]