Subject: | Bizarre failure for $tied_obj->{scalar} passing vs. $scalar passing |
This may be a XS thing that needs to be checked for, but passing tied
variables has some bizarre failures:
use String::LCSS_XS 'lcss';
use SNMP;
SNMP::loadModules('ALL');
SNMP::initMib();
my $g = '.1.3.6.1.2.1.10.127.6';
print "LCSS:
".lcss($SNMP::MIB{'DOCS-QOS-MIB::docsQosPktClassTable'}->{objectID},
$g)."\n";
my $h = $SNMP::MIB{'DOCS-QOS-MIB::docsQosPktClassTable'}->{objectID};
print "LCSS: ".lcss($h, $g)."\n";
This prints:
LCSS:
LCSS: .1.3.6.1.2.1.10.127.
So, merely storing the variable into a scalar fixes the problem, but it
shouldn't react this way. Pure Perl would always pass the real value at
that point, so this has to be some sort of type casting problem with XS.
I've already checked a standard object ref pass, and that works. It's
only with tied ones.