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

Re: [MacPerl-Modules] Glue




My vote would be for getting a hashref... I tend to use hashrefs and
arrayrefs exclusively, since they are passed as scalars, and the syntax
scales up uniformly...

	$h->{key}
	$a->[index]
	$x->[index]->{key}

It's not nice to break old code, so you could introduce 'ppp_status_href'
or some such.

since you asked,
rkm

----------------------------------------------------------------------------
9/14/1999, Chris Nandor wrote:
>But if it returned a hash
>reference instead of a hash, the advantages would be:
>
>  1.  Nicer abbreivated syntax:  $p->ppp_status->{state}
>  2.  Lower memory requirements if a big record is returned (not likely with
>      Apple events)
>
>Disadvantages:
>
>  1.  Must assign my $hash = $p->ppp_status, and then call $hash->{key}
>      instead of my %hash = $p->ppp_status, $hash{key}; breaks old code
>      and is more effort to use in some cases (two extra chracters to type!)
>
>There are probably more.  Any suggestions?


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