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

Re: [MacPerl-Modules] Glue



At 07.41 -0400 1999.09.14, Dave Johnson wrote:
>I've been playing with the glue modules trying to learn how they work.
>While the
>following gives me what I want (The status of my PPP connection.):
>
>#!perl -wl
>use Mac::Glue ':all';
>use strict;
>
>my($p, %params, $params);
>$p = new Mac::Glue 'Finder';
># Get status of PPP
>%params = $p->ppp_status();
>print  $params{'RAsb'};
>
>I get the feeling I am missing something and there is a cooler way such as:
>
>print $p->prop('state', of => $p->ppp_status());  # does not work

OK, I have added support for the next version of Mac::Glue so this will now be:

  print $p->ppp_status->{state};

Basically, Mac::AppleEvents::Simple will continue to return a plain old
hash (list, really), but Mac::Glue checks to see if the descriptor is of
typeAERecord, and if it is, it converts the 4-char IDs to the proper name
(in this case, 'RAsb' becomes 'state') and returns the whole thing as a
hashref.

-- 
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