in reply to Passing hash and hashref to sub
print Dumper %amazonResults
You'll get prettier output if you make a reference from your hash: \%amazonResults. Also look at Data::Dump. It gives you a better (IMO, of course) looking output and a better interface (pp \%amazonResults instead of print Dumper ...).
&processAmazonQuery(...)
Please get out of the habit of prefixing subroutine calls with "&". It'll just lead to mysterious bugs sooner or later.
my (%hash, $conf) = @_
You can't pass a hash into a subroutine like that. %hash will take everything from @_ leaving nothing for $conf. Either use a hashref in your call: processAmazonQuery(\%amazonResults, $conf) and my ($hashref, $conf) = @_; my %hash = %$hashref in your sub (or rewirite the sub to use the reference instead).
Or, you could use my $conf = pop @_; my %hash = @_
I'd recommend rewriting the sub so it uses a hashref instead of a hash.
|
|---|