use strict; use warnings; my $string = "Hello World"; my ($index,$a)= 0; for( ; $a = substr($string,$index,1) ; $index++) { print $a."\n"; } ####