leftop gotcha
[email protected] (Marcel Grunauer)
| Newsgroups | perl.recdescent |
|---|---|
| Message-ID | <20011028103832.KNJC15000.viefep16-int.chello.at@localhost> |
Here's a gotcha that I didn't find documented:
I used the lazy leftop syntax in a rule like this:
list: token1 element(s /,/) token2
and wanted to get a list of all the elements that were matched, so
I assumed $item{element} would contain it. However, that only
contains the *last* element that was matched. That's because
internally the above syntax is converted to a <leftop> directive
(you can see that if you use trace the build), and that is really
what you need:
$item{__DIRECTIVE1__}
Marcel
--
Aspect-Oriented Perl http://codewerk.unixbeard.net/aspects/
cpan> install Aspect