Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: Net::Dict not acting expectedly

by jasonk (Parson)
on Mar 16, 2003 at 19:44 UTC ( #243517=note: print w/replies, xml ) Need Help??

in reply to Net::Dict not acting expectedly

The documentation tells you that define() returns an array ref, which contains multiple arrayrefs, each of which lists the dictionary searched and the definition of that word from that dictionary. So what you need is this:

foreach(@{$dict->define('banana')}) { # check each result print "$_->[0]: $_->[1]\n"; # 0:dictionary 1:definition }

By the way, Data::Dumper is the perfect tool for debugging these types of things, just use print Dumper($dict->define('banana')); and you can see at a glance what the structure of the data you are getting back is.

We're not surrounded, we're in a target-rich environment!

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2022-01-28 20:29 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (73 votes). Check out past polls.