Your key should be 'range(?)' — as the docs say:
"The results of named subrules are stored in the hash under each subrule's name (including the repetition specifier, if any)"
With that change, i.e.
if (defined @{$item{'range(?)'}->[0]}) { my @arr = @{$item{'range(?)'}->[0]}; foreach my $i (@arr) { print $i."\n"; } }
I do get the expected output:
input 2 0 a
In reply to Re: RecDescent Issue: using item hash with (?) repetition specifier
by almut
in thread RecDescent Issue: using item hash with (?) repetition specifier
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |