@terms = qw/.A. .C./; my $clause= join "|", map quotemeta ,@terms; while (my $line = <DATA>){ print $1 while $line =~m/UP($clause)LB/g; } __DATA__ UP.A.LB UP.B.LB UP.C.LB
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!
In reply to Re: Comparing string to array elements
by LanX
in thread Comparing string to array elements
by R56
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |