Not quite (for the values being blank):
#!/usr/bin/perl my $env = "1 2 3 4 5"; my %h = split //, $env; use Data::Dumper; print Dumper \%h;
Output:
$VAR1 = { '4' => ' ', '1' => ' ', '3' => ' ', '2' => ' ', '5' => undef };
s**lil*; $*=join'',sort split q**; s;.*;grr; &&s+(.(.)).+$2$1+; $; = qq-$_-;s,.*,ahc,;$,.=chop for split q,,,reverse;print for($,,$;,$*,$/)
In reply to Re^2: splitting directly to hash
by chargrill
in thread splitting directly to hash
by narashima
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |