From e27ac13e68e3448ab4198e78b35cedf7906b8391 Mon Sep 17 00:00:00 2001 From: tTh Date: Wed, 16 Oct 2024 21:44:18 +0200 Subject: [PATCH] a new little tool --- code/Perl/getip.pl | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 code/Perl/getip.pl 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());