http://www.perlmonks.org?node_id=243517


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!