in reply to Array to hash refs
use strict; my @array = qw/a b c d e f/; my $t = my $hashref = {}; while (@array) { $t = $t->{ shift @array } = @array>1 ? {} : 1 };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Array to hash refs
by Anonymous Monk on Aug 14, 2002 at 11:27 UTC |