sub reftype { my $ref = shift; $ref =~ s/\(.*\)$//; # get rid of the (0x0000000) portion of the reference $ref =~ s/^.*=//; # get rid of the CLASS= portion of the reference return $ref; }