in reply to Re: splitting directly to hash
in thread splitting directly to hash
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($,,$;,$*,$/)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: splitting directly to hash
by Cabrion (Friar) on Nov 22, 2006 at 01:08 UTC |