in reply to Re: Convert a string into a hash
in thread Convert a string into a hash
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... ;-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Convert a string into a hash
by ikegami (Patriarch) on Aug 15, 2009 at 02:18 UTC | |
by vitoco (Hermit) on Aug 15, 2009 at 03:34 UTC | |
by ikegami (Patriarch) on Aug 15, 2009 at 15:48 UTC | |
by vitoco (Hermit) on Aug 15, 2009 at 16:56 UTC | |
|
Re^3: Convert a string into a hash
by Your Mother (Archbishop) on Aug 14, 2009 at 23:20 UTC | |
by ikegami (Patriarch) on Aug 15, 2009 at 02:25 UTC | |
by Your Mother (Archbishop) on Aug 15, 2009 at 04:27 UTC | |
by ikegami (Patriarch) on Aug 15, 2009 at 15:52 UTC | |
by vitoco (Hermit) on Aug 15, 2009 at 03:19 UTC | |
by roboticus (Chancellor) on Aug 15, 2009 at 13:04 UTC |