I'm sorry for not being so clear. English is not my native language, so I decided just to write the code in the usual way with a minimum of info about the context. I thought this thread as a perl coding hackers topic.
BTW, my best code really was:
my %code = (my $i = 0 or map {($_, $i++)} split(/,/, $tokens));The previous was an updated one using => instead of the subarray, a more elegant code based on your reply, but I didn't notice my mistake when I pasted the line.
In reply to Re^4: Convert a string into a hash
by vitoco
in thread Convert a string into a hash
by vitoco
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |