in reply to Prototype mismatch

Amazon::SQS::Simple doesn't export any subs by default, so it seems very unlikely that this is clashing.

But are you sure you're giving us the code that generates these messages? The last one talks about line 214, and while I didn't count the lines of your snippet, I'm pretty sure it isn't 214 lines long.

Note, this is not an invitation to post 214 or more lines of code. But it does help to post code and errors that match.

Replies are listed 'Best First'.
Re^2: Prototype mismatch
by caxtor (Initiate) on Apr 12, 2012 at 18:26 UTC

    Full code here:

    use strict; use Carp qw( carp croak ); #********************************************************************* +** # Configuration: #********************************************************************* +*/ my $QUEUE_URL = "https://queue.amazonaws.com/..."; my $AWS_ACCESS_KEY_ID = ""; my $AWS_SECRET_ACCESS_KEY = ""; #********************************************************************* +** # USE Amazon Libraries #********************************************************************* +*/ use Amazon::SQS::Simple; #********************************************************************* +** # USE Other Libraries #********************************************************************* +*/ use Thread::Pool; #********************************************************************* +*** # Create new objects #********************************************************************* +**/ #AMAZON SQS my $sqs = new Amazon::SQS::Simple($AWS_ACCESS_KEY_ID, $AWS_SECRET_ACCE +SS_KEY); $| = 1; #Quick buffer #-----------------------------------------------------------------# my $q = $sqs->GetQueue($QUEUE_URL); my $msg; while (1) { $msg = $q->ReceiveMessage(); if ($msg != "") { #New message found, process message print $msg->MessageBody(); #$pool->job($body); print " -> Job sent to pool!\n"; #Delete message from queue #$q->DeleteMessage($msg->ReceiptHandle()); } else { print "No new messages.\n" } #Polling interval sleep(2); }
      So, what's on line 214 of load.pm, and how does that get called?
        #--------------------------------------------------------------------- +---------- # _scan # # Set up / load given module # # IN: 1 module to scan (AAA::BBB) # 2 optional: flag to load everything now sub _scan { my $module= shift; my $loadnow= defined( $_[0] ) ? shift : $now; # make sure we won't clobber sensitive system vars local $_= \my $foo; # make sure $_ is localized properly local( $!, $@ ); # open the file to read 214-> my $file= _filename( $module ) or die "Could not find file for '$module'"; open( VERSION, "<$file" ) # use VERSION as glob to save memory or die "Could not open file '$file' for '$module': $!"; binmode VERSION # needed for Windows systems, apparently or die "Could not set binmode on '$file': $!";