use utf8; binmode(STDOUT, ":utf8"); my $string = "azsc"; while( $string =~ /(\w)/g ){ print $1; } print "\n"; __OUTPUT__ azsc