in reply to How do I return a hash from Parse::RecDescent?
Hmm, here's one way:
... test: expr(s) /^\Z/ { my %hash; @hash{keys %$_} = values %$_ for @{$item{"expr(s)"}}; return \%hash; } ...
Prints:
$HASH1 = { x => 1, y => 2, z => 3 };
Is there anything "better"?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How do I return a hash from Parse::RecDescent?
by ikegami (Patriarch) on Sep 22, 2006 at 05:29 UTC |