in reply to Arrays and strings
It's generally considered better form to use a hash, however.my $word = 'millennium'; { no strict 'refs'; @$word = (); }
Of course, since split predates references in Perl, you may still be stuck.my %arraysfromwords; $arraysfromwords{ $word } = [];
Another option is to upgrade to a modern version of Perl with a working split, and use Inline::C. Since a string in C can be treated as an array of char pointers, all you have to do is to pass the SV to C, extract the string, create a new AV, and populate it with pointers to the new SVs representing each character.
I'd probably just use split though, and save myself thirty seconds.
|
|---|