in reply to How to split a string
Yes, but it's very bad practice, because it's just too easy to make errors, and it makes your code much less readable. You could use an array instead:
my @f = split(//, $s);
A alternate way to split the string:
my @f = $s =~ /./gs;
An example of how to manipulate the array:
print("\@f has ", scalar(@f), " elements:\n"); print("\$f[$_] = $f[$_]\n") for (0..$#f);
|
|---|