my @list; my $string = "hi there"; while($string) { push @list, chop($string); } foreach(reverse(@list)) { print "$_\n"; }