Sara wrote:
> 
> ----- Original Message ----- From: "Ovid"
> 
>> --- Sara <[EMAIL PROTECTED]> wrote:
>>
>>> while (my $row = $sth->fetchrow_hashref)
>>> {
>>>   if (grep /$row->{CAT_TITLE}/, @present) {
>>>   #matching title with @present elements
>>>   print "$row->{CAT_TITLE}";
>>> }
>>>
>>> Question is how to do EXACT matching using GREP? because the above
>>> code prints every element from array for 'php' if the
>>> $row->{CAT_TITLE} is 'php' it prints php/counters, php/forums and
>>> every element containing php.
>>
>> Assuming I understood your question correctly:
>>
>>  if (grep { $_ eq $row->{CAT_TITLE} } @present) {
>>    # do something
>>  }
> 
> No, it's not working, probably you didnt' get my question.

That's the way I read it and that is how you do it in Perl.  It looks like you
think that Perl's grep is the same as the grep program you use on the command
line but it is not.


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to