in reply to Re: Parsing through a menu hash.
in thread Parsing through a menu hash.
which allows you to write (untested!!!):sub pointer_to_element { require List::Util; return List::Util::reduce(sub { \($$a->{$b}) }, \shift, @_); }
while(<DATA>) { chomp; my @chunks = split /\:/; next unless @chunks > 1; # At least one key, please my $value = pop @chunks; push @{ pointer_to_element($DATA, @chunks) }, $value; }
Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf
|
|---|