in reply to Re: Prototype mismatch
in thread Prototype mismatch

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); }

Replies are listed 'Best First'.
Re^3: Prototype mismatch
by JavaFan (Canon) on Apr 12, 2012 at 18:42 UTC
    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': $!";