I can't test this (because WHOIS queries are blocked from my current location), but if I'm reading the docs correctly, the query command returns
Net::Whois::RIPE::Object objects, as opposed to something printable. But you should be able to get some kind of more meaningful response by changing
print $line;
to something like
foreach $attribute ($line->attributes()) {
foreach $value ($line->$attribute()) {
printf "%s: %-s\n", $attribute, $value;
}
}
For more details, my example was cribbed from
this page.