Skip to content
Browse files

Fixes a couple of incorrect deference (THRIFT-758)

This is a nasty error that is triggered during exception, leaving
the user clueless about the error since she gets a Perl error
instead:

"Can't use string ("0") as a SCALAR ref while "strict refs" in use"

For instance:
http://stackoverflow.com/questions/2488783/why-do-i-get-an-error-when-inserting-rows-with-netcassandraeasy-and-cassandra
  • Loading branch information...
1 parent c78ee9f commit 4f54015ac02dc33ea4ae22c8b80389e5d6ee9ae6 @yannk committed Apr 14, 2010
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/perl/lib/Thrift.pm
View
8 lib/perl/lib/Thrift.pm
@@ -93,11 +93,11 @@ sub read {
my $ftype = 0;
my $fid = 0;
- $xfer += $input->readStructBegin($fname);
+ $xfer += $input->readStructBegin(\$fname);
while (1)
{
- $xfer += $input->readFieldBegin($fname, $ftype, $fid);
+ $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
if ($ftype == TType::STOP) {
last; next;
}
@@ -107,7 +107,7 @@ sub read {
/1/ && do{
if ($ftype == TType::STRING) {
- $xfer += $input->readString($self->{message});
+ $xfer += $input->readString(\$self->{message});
} else {
$xfer += $input->skip($ftype);
}
@@ -117,7 +117,7 @@ sub read {
/2/ && do{
if ($ftype == TType::I32) {
- $xfer += $input->readI32($self->{code});
+ $xfer += $input->readI32(\$self->{code});
} else {
$xfer += $input->skip($ftype);
}

0 comments on commit 4f54015

Please sign in to comment.
Something went wrong with that request. Please try again.