use strict; my $word = shift @ARGV || "SPACE"; my $count = $word; while( chop $count ) { my $t = chop $word; $word = $t . $word; print $word, "\n"; } #### $temp = chop($word) . $temp, print "$temp$word\n" while $word; # $temp and $word should, of course, be initialized.