diff --git a/code/Perl/getip.pl b/code/Perl/getip.pl new file mode 100755 index 0000000..b861fff --- /dev/null +++ b/code/Perl/getip.pl @@ -0,0 +1,8 @@ +#! /usr/bin/perl +use strict; +use LWP::UserAgent (); +my $ua = LWP::UserAgent->new(agent => "curl"); +my $url = "https://ifconfig.io"; +my $req = HTTP::Request->new('GET' => $url); +my $res = $ua->simple_request($req); +print($res->content());