in reply to RecDescent Issue: using item hash with (?) repetition specifier
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
|
|---|