#! perl -slw use strict; use re 'eval'; my $users = { wilma => { pattern => '(?:[Ff]red|Pebbles)' }, betty => { pattern => '(?:(?:(?:[Bb]am ?){1,2})|[Bb]arney)' }, fred => { pattern => '(?i:wilma|barney)' }, barney => { pattern => '(?i:betty|fred)' }, }; our @users; my $bigRe = '(?{ @users = () })' . join( '', map{ qq[(?=.*($users->{$_}{pattern})(?{ \$^N and push our \@users, '$_' }))?] } keys %$users ); $bigRe = qr[$bigRe]; #print $bigRe; while( ) { chomp; $_ =~ m[$bigRe]g; print "users [@users] selected: '$_'" if @users; } __DATA__ *Fred Flintstone. He is a roly-poly rotund fellow. I always found it amazing, that he wore the same outfit day in and day out. Fred works in a stone quarry. He sits atop a dinosaur and makes the dinosaur move boulders. His boss is Mr. Slate. Fred is the typical prehistoric man. His enormous appetite is amazing. How he managed to keep as slim as he is, I will never know. haha. Fred is also a member of a lodge and he loves to bowl. His name is twinkletoes at the bowling alley. *Wilma Flintstone. Wilma is married to Fred. She is a slim, willowy woman who wears a provocative-looking dress all the time. How she ended up with fat Fred, I will never know. Wilma keeps a very clean and neat looking stone house. I was always amazed at the size of her house. From the outside, it looks small. Wilma and Fred Flintstone have neighbors, who happen to be their closest friends and partners in crime. *Barney Rubble. He is shorter than Fred. He is Fred's best friend and always ends up involved in Fred's shenanigans. Barney rides to work with Fred. This is not a good arrangement because Barney has had to run after Fred on more than one occasion. Barney is also married to a pretty woman. Her name is Betty. *Betty Rubble. She is taller than Barney and weighs about 50 pounds less than him. She has black hair that is usually styled the same way day after day. Her best friend is Wilma, of course. Their houses are side by side, so Betty is at Wilma's house a lot and vice-versa. Neither Betty nor Wilma work for a living. Wilma and Betty have one child each. They are: *Pebbles. She is the daughter of Wilma and Fred. She is a very cute little red headed baby. Of course, over the years, she did grow up. Pebbles is one of the happiest and smartest babies ever on television. *Bam-Bam. Barney and Betty did not give birth to Bam-Bam. Someone left him in a basket on their doorstep in the middle of the night. It just so happens, the night before, Barney and Betty had wished for a child because they wanted to be parents. Bam-Bam is adopted by Barney and Betty. He is a very strong little baby. Of course, Bam-Bam and Pebbles end up closest of friends, and both family's are happy. Fred Flintstone also has to endure living with animals also. They have a dinosaur named Dino and a saber toothed tiger cat. Dino really loves Fred and loves to greet him when he comes homes. Fred, on the other hand, does not like how Dino greets him. Dino is purple and he also just so happens to be a good baby sitter/watchdog for Pebbles. Barney and Betty have a kangaroo type animal named Hoppy. Hoppy and Dino are best friends. Hoppy also lets Bam-Bam get in his pouch. One of the other somewhat main characters of this cartoon is a genie named Kazoo. He only can be seen by Fred and Barney. He has helped Fred get out of more than one fix. In other episodes, when Fred needed Kazoo, he would not be anywhere around. Fred drives his car with foot power. I was always amazed at the distances he could drive with his feet. You would think that a stone car would be hard to push, let alone drive with your feet. It is just amazing the technology that was available back in the stone age days.