Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^4: Help with Geo::IP output

by haukex (Archbishop)
on Jun 24, 2020 at 14:07 UTC ( [id://11118429]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Help with Geo::IP output
in thread Help with Geo::IP output

As with the other post today, in a piped open, close needs to be checked for errors as well. Or, let me just plug my relatively new module IPC::Run3::Shell::CLIWrapper ;-)

use JSON::PP qw/decode_json/; use IPC::Run3::Shell::CLIWrapper; my $geoip = IPC::Run3::Shell::CLIWrapper->new( { fail_on_stderr=>1, stdout_filter => sub {$_=decode_json($_)} }, qw/ geoip --json --DB=dbi:SQLite:dbname=geoipdb / ); my $data = $geoip->('209.197.123.153');

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11118429]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-04-18 01:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found