my $string='computer'; my $len= 3; my @strings= map substr($string,$_-$len,$len),($len..length $string); print join "\n",@strings,'';