in reply to grep with looped tests
I couldn't resist solving this with 2 nested grep! =)
DB<100> @x=1..10 => (1, 2, 3, 4, 5, 6, 7, 8, 9, 10) DB<101> @re=qw/ 3 7 1 / => (3, 7, 1) DB<102> grep { my $data=$_; grep { $data =~ /$_/ } @re } @x => (1, 3, 7, 10)
Cheers Rolf
(addicted to the Perl Programming Language)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: grep with looped tests
by RichardK (Parson) on Jun 06, 2014 at 15:57 UTC | |
by LanX (Saint) on Jun 06, 2014 at 16:03 UTC | |
Re^2: grep with looped tests
by Laurent_R (Canon) on Jun 06, 2014 at 20:55 UTC | |
by LanX (Saint) on Jun 07, 2014 at 15:45 UTC | |
by Laurent_R (Canon) on Jun 08, 2014 at 09:24 UTC | |
by LanX (Saint) on Jun 08, 2014 at 12:10 UTC |
In Section
Seekers of Perl Wisdom