I do need the corresponding values, because I'll sort a given list of tokens from this set. johngg got the idea!
This was the best I could do:
my %code = ( my $i = 0 or map { $_ => $i++ } split /,/, $tokens );but I wanted to have no temporary variables... ;-)
In reply to Re^2: Convert a string into a hash
by vitoco
in thread Convert a string into a hash
by vitoco
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |