split /[\w|\W]/
you meant
split /[\w\W]/
or
split /\w|\W/
The above would be better written as
split /./s
That said, it doesn't work. If you want to separate every character, the characters aren't the separators, the nothings between each character are. You want:
split //, $x
The following would also do:
$x =~ /./sg
In reply to Re^2: split chars in string
by ikegami
in thread split chars in string
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |