http://www.perlmonks.org?node_id=1029377


in reply to Need to return the first occurance of a search

hum, can't see the point on cloning the red hat package manager

I'll suggest simply to use system("rpm ...") for this

And please, note that this is not a "first occurrence's problem", it is a "categorizing packages" problem. You want to print the parent (upper node of the tree) package, not the first package that match the regex