Below is an example code that will split a string into an array of char[] like C/C++ or other language. There is no built in function in Perl to do such task. Hope below example will helpful for many people.
## String to convert into char array
my $str = "my name is deadman";
## Spliting the string with no delimeter.
my @char_array = split(//,"$str");
foreach my $char (@char_array){
print $char . "\n"
}
Comments
Also, it's a rare operation, because after all, the regex stuff wants strings, not chars. Not much of Perl deals with chars.