> uh...
>
> my $lookfor = qr/car/; # this is faster and you don't even
> need to put in the //
> > ---
> > use strict;
> >
> > my @array = qw(car bus caravan bike cart);
> >
> > my $lookfor = "car";
> >
> > foreach my $element (@array) {
> > if ($element =~ /$lookfor/) {
> > print "Found a match!! => $element\n";
> > } else {
> > print "$lookfor doesn't match $element\n";
> > }
> > }
Are you saying the if inside the foreach could be written as:
if($element =~ $lookfor) {
If the search string is defined with qr//?
-dave
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]