splitstring.cgi

Given the string:


my $str = "abcdefg1234567890";

To split it into characters you could use substr function within a loop:

for my $n (0 .. length($str)-1) {
  $str[$n] = substr($str, $n, 1);
}

$ a:b:c:d:e:f:g:1:2:3:4:5:6:7:8:9:0:

.. or use split function and empty delimiter :

 @str  = split//, $str;

$ a:b:c:d:e:f:g:1:2:3:4:5:6:7:8:9:0: