Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use strict;
- use warnings;
- use LWP::UserAgent;
- my $ipAddress = "192.168.0.1"; #put the ip
- my $ua = LWP::UserAgent->new;
- my $response = $ua->get("http://ip-api.com/json/" . $ipAddress);
- if ($response->is_success) {
- my $responseBody = $response->decoded_content;
- print $responseBody;
- } else {
- print "Unable to retrieve website information for IP address: " . $ipAddress;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement