By the way, here's a shorter solution:
my $keys = '1 2 3 4 5 6'; my %hash = $keys =~ /(\S+)()/g;
To use an environment variable, substitute $keys with $ENV{varname}.
In reply to Re^3: splitting directly to hash
by ikegami
in thread splitting directly to hash
by narashima
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |