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

Re: Net::Dict not acting expectedly

by jasonk (Parson)
on Mar 16, 2003 at 19:44 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2025-01-18 08:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (56 votes). Check out past polls.