[Kc] infix pointer question

JYOUNG79 at kc.rr.com JYOUNG79 at kc.rr.com
Thu Aug 31 09:01:44 PDT 2006


Just curious if someone wouldn't mind explaining how the 'infix' 
pointer works?  I've been looking at some code here at work that an 
outside programmer did a long time ago.  I'm totally confused as to how 
this works:

-----------------------------
At first it looks like it's getting info for the scalar $HKrepobj...
-----------------------------

# Grab the HKreport data block
my $HKrepobj = $repobj->getHKreportobj( );


sub getHKreportobj
{
	my ( $obj ) = @_;
	return $obj->{ 'HKreport' };
} # end sub getreportobj



-----------------------------
Next it's getting info for the scalar $madeinstr...
-----------------------------

my $madeinstr = $HKrepobj->getmadein( );

sub getmadein
{
	my ( $obj ) = @_;
		# Make a shortcut to the actual data hash.
	# my $dh = $obj->{ 'data' };
	# return $dh->{ 'madein' };
	return $obj->{ 'data' }{ 'madein' };
} # end sub getmadein


I've researched a little about this - it looks like 'infix' pointers 
dereference a reference??  I understand tha
t a reference is a value that holds the location to another value but 
the syntax above just doesn't seem to make any sense to me.  Instead of 
using 'infix' pointers why not just return a regular scalar value or 
array?

Thanks.

Jay


More information about the kc mailing list