On Jul 4, 2004, at 1:23 PM, Chris Nandor wrote:

In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Ken Williams) wrote:

When I get a record from the Address Book like so:

   use Mac::Glue ':all';
   my $ab = Mac::Glue->new('Address Book');
   my $person = $ab->obj( people => whose(AND =>
        [[ first_name => begins_with => 'Smorgasbord' ],
         [ last_name  => equals      => 'Milhouse'    ]] );

I can't seem to tell the difference between someone who doesn't exist
in the Address Book, and someone who exists but has no phone number (or
address, or whatever). Any tips on how to do this?

I am not sure what you're asking. Are you saying someone who exists but
doesn't have any contact info -- just a name -- won't be returned by this?
I works for me (modifying your parens/brackets slightly):


   print my $person = $ab->obj( people => whose(AND =>
      [ first_name => begins_with => 'S' ],
      [ last_name  => equals      => 'Wonder'    ] ))->get;

That returns for a card for the name Stevie Wonder, with no other info. If
I change it to "Sn" "Wonder", I get an uninitialized value warning in the
print.

Ah, I see - I was trying to tell the difference between a "hit" and a "miss", i.e. a search that found someone and a search that didn't. Looks like I can use defined($person->get) for it, thanks.


 -Ken



Reply via email to