The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
#!/usr/bin/perl
use strict; use warnings;

my $dst = shift || die("Pass dst");

use Net::Libdnet::Route;

my $h = Net::Libdnet::Route->new;
my $ret = $h->get($dst);
$ret ? print "GW: $ret\n" : print "Same subnet\n";