Tk::Error: Can't call method "reverse_ip" without a package or object reference at C:\_SCRIPT\Perl\DNS\TkNMLookup.pl line 21. Tk callback for .button Tk::__ANON__ at C:/Perl/lib/Tk.pm line 252 Tk::Button::Invoke at C:/Perl/lib/Tk/Button.pm line 135 (command bound to event) #### ### Moduels to use use Tk; use Net::IP; use Net::DNS; ### New Window my $mw = MainWindow->new; $mw->title("IP Lookup"); $mw->Label(-text => "Enter an IP Address")->pack; $mw->Entry(-textvariable => \$a)->pack; $mw->Button(-text => "Lookup", -command => \&rlookup)->pack; $mw->Entry(-textvariable => \$b)->pack; MainLoop; sub rlookup{ use Net::IP; use Net::DNS; my $ARGV = $a; # print $ARGV; my $ip = new Net::IP($ARGV[0],4); my $res = new Net::DNS::Resolver; my $answer = $res->query($ARGV->reverse_ip(),'PTR'); my $namer = $answer->{'answer'}[0]; $b = $namer->{'ptrdname'}; }