Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^3: WWW::Wordnik::API output

by greengaroo (Hermit)
on Nov 20, 2012 at 19:43 UTC ( #1004782=note: print w/ replies, xml ) Need Help??


in reply to Re^2: WWW::Wordnik::API output
in thread WWW::Wordnik::API output

I suggest you use strict; because you would have received an error instead of nothing.

This:

foreach (sort keys %hashref) { print "$_ : $hashref{$_}\n"; }

Should be replace by this:

foreach (sort keys %{$hashref}) { print "$_ : ", $hashref->{$_}, "\n"; }

I was using a HashRef not a Hash, $hashref is not the same variable as %hashref, so if you loop through %hashref, of course you get nothing because it is an empty variable. Using strict would have prevent you from doing this. I hope this helps!

Testing never proves the absence of faults, it only shows their presence.


Comment on Re^3: WWW::Wordnik::API output
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1004782]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (9)
As of 2015-07-28 09:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (254 votes), past polls