in reply to format json response

This should work:

my $json = qq/{\n\t"balance": 999000000\n}\n/; my $data = decode_json($json); my $balance = $data->{balance}; print $balance, "\n"; # prints "999000000"

The decode_json function is provided by many of the JSON modules, personally I prefer Cpanel::JSON::XS. You can use Data::Dumper or Data::Dump to inspect its return value, and then dereference it accordingly (perlreftut).

use Shell;

Note that Shell is fairly dangerous, as it'll turn any unknown function call into a system command. I assume libra is that shell command? You might be interested in my module IPC::Run3::Shell, which is heavily inspired by Shell, but I've added a bunch of features (and, relatively speaking, more safety from common problems).

use IPC::Run3::Shell { chomp=>1 }, qw/ libra /; my $balance = libra(qw/ account balance f270b16e2fec7a10937d0c32eec34a +9b2280a7ab8a64e75aa8c84e3583158349 /);