aws-sdk-perl icon indicating copy to clipboard operation
aws-sdk-perl copied to clipboard

Cannot use DynamoDB QueryAll and ScanAll with callback

Open usausat opened this issue 6 years ago • 1 comments

When using DynamoDB QueryAll and ScanAll with callback, it does not work properly.

For example,

#!/usr/bin/perl
use Paws;

$dynamo->ScanAll(
    sub {
        my ( $item, $name ) = @_;
        print "$item, $name\n";
    },
    TableName   => 'MyTable',
);

This program will die as follows:

% perl sample.pl
Paws::DynamoDB::AttributeMap=HASH(0x803c05498), Items
Paws::DynamoDB::AttributeMap=HASH(0x803bdc2e8), Items
Paws::DynamoDB::AttributeMap=HASH(0x803c07a68), Items
Paws::DynamoDB::AttributeMap=HASH(0x803bf8a50), Items
Paws::DynamoDB::AttributeMap=HASH(0x803bf8180), Items
Can't use string ("26") as an ARRAY ref while "strict refs" in use at /usr/local/lib/perl5/site_perl/Paws/DynamoDB.pm line 347.

and so is QueryAll.

To fix this problem, try to apply this patch.

p5-Paws-DynamoDB-0.40.patch.txt

usausat avatar Jun 26 '19 02:06 usausat

Thank you for your patch :)

pplu avatar Jun 26 '19 07:06 pplu