use strict; my $word = shift @ARGV || "SPACE"; my $count = $word; while( chop $count ) { my $t = chop $word; $word = $t . $word; print $word, "\n"; }