Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Re: Adjacency List Processing in XML::Twigby chipmunk (Parson) |
on Aug 18, 2001 at 17:50 UTC ( [id://105912]=note: print w/replies, xml ) | Need Help?? |
Changing the nested grep to a grep map would change the semantics of the code.
This nested grep returns a list of elements for which any child contains the search text. This grep map a list of individual children that contain the search text.
With a search for 'menlo park', the nested grep returns two elements; one has the children '<city>menlo park</city>' and '<city>palo alto</city>', and the other has the children '<city>atherton</city>' and '<city>menlo park</city>'. The grep map, on the other hand, would just return '<city>menlo park</city>' and '<city>menlo park</city>'.
In Section
Tutorials
|
|