http://qs321.pair.com?node_id=29474


in reply to PUZZLED

use strict; my $string = shift @ARGV || 'space'; my $length = length $string; $string .= $string; for my $start (0 .. $length-1) { print substr($string, $start, $length), "\n"; }
Uses twice as much space, but could save time if moving characters around is expensive.