I thought that for (split //, $string) { would cost a lot of memory if $string is long, but now I'm not sure. | [reply] [d/l] |
It will cost a lot of memory. Fortunately, $string is rarely large. And if it is large, the regex-iterator solution will probably be slow. You'll probably be better off with a substr solution on large strings.
---- I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
: () { :|:& };:
Note: All code is untested, unless otherwise stated
| [reply] [d/l] [select] |
| [reply] |