use strict; use warnings; my $string = "Hello World"; while($string =~/(.)/g){ print "$1\n"; }