Help for this page

Select Code to Download


  1. or download this
    use JSON::MaybeXS;
    open my $gh, "-|", "geoip", "--json", $url_or_hostname or die;
    my $data = decode_json (do { local $/; <$gh> });
    say $data->[0]{provider}; # [0] as it returns a list of matches