[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl-Modules] Glue: Fun with reference forms again



At 9:32 -0500 1999.09.11, Jefferson R. Lowrey wrote:
>At 8:26 PM -0400 9/10/99, Chris Nandor wrote:
>>At 15:41 -0500 1999.09.10, Jefferson R. Lowrey wrote:
>>>If, however, I try and use the Owner names to populate a hash
>>>for my $item (@selection) {
>>>	my $user = $netOGlue->get($netOGlue->obj(cell => 'Owner' => $item));
>>>	$report{$user}{'status'} = 'ready';
>>>	$report{$user}{'reason'} = undef;
>>>	print "report initialized for $user\n" if $debug;
>>>};
>>>
>>>by putting the result of the get into the scalar $user, I lose the list.
>>
>>What do you mean, you lose the list?
>
>Um. I guess what I mean is this: I only get a printout that shows the first
>owner name from the section.  That is, if the get returns something like
>{'Kathi','Kristi','Mark','Malcolm'}, I would get only
>report initialized for Kathi
>
>It's possible I actually have keys defined for Kristi, Mark and Malcolm as
>well, but it doesn't tell me that I do, so I can't trust it.
>
>If I do it the other way, I get report lines for Kristi, Mark, and Malcolm
>like I expect.

I see.  Yes, it is the same with any programming, and any Perl programming:
you need to know what your data is.  If your get() call potentially returns
a list, then you need to handle it as a list.  I imagine you'd need to
something similar if the code were in AppleScript, too.

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-modules-request@macperl.org