Well, I've started my Perl 6 programming career already and I've got stuck. :)
I'm trying to parse a Linux RAID table (/etc/raidtab), which looks a bit like this: raiddev /dev/md0 raid-level 5 option value option value ... device /dev/sde1 raid-disk 0 device /dev/sdf1 raid-disk 1 device /dev/sdg1 raid-disk 2 ... raiddev /dev/md1 ... Here's the grammar I have so far: grammar Raidtab; rule raidtab { <raiddev>+ }; rule comment { <sp*> \# .* | # Or a blank line ^^ \n }; rule comm_eol { <sp*> <comment>? <sp*> \n }; rule raiddev { <comment>* <sp>* "raiddev" <sp>+ $name := (/dev/md\d+) <comm_eol> (<devicelayout> | <option> | <comment>)+ }; rule option { <sp>* $key := (<[a-z]->+) <sp>* $value := (\w+) <comm_eol> }; rule devicelayout { <sp>* device <sp>+ $name := (/dev/\w+) <comm_eol> <sp>* $type := (raid|spare|parity) -disk <sp>* $index := (\d+) <comm_eol> }; What I can't figure out is how to drill down into the returned match object and get at individual devices. I'd expect to be able to say something like $matchobject{raiddev}[0]{devicelayout}[1]{name} and get "/dev/sdf1". Is that how it works, with multiply-matched rules being put into arrays, or is it stored differently somehow? -- 3rd Law of Computing: Anything that can go wr fortune: Segmentation violation -- Core dumped