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');
In reply to Re^4: Help with Geo::IP output
by haukex
in thread Help with Geo::IP output
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |