Group
Extension

Matches 1

Number-UN ( T/TA/TANTALOR/Number-UN-0.003.tar.gz, TANTALOR, 2013; MetaCPAN )
Number-UN/lib/Number/UN.pm ( view source; MetaCPAN )
 strict;
use warnings;

use JSON 'decode_json';
use Path::Class 'file';

use Exporter 'import';
our @EXPORT_OK = qw(get_un);


sub get_un {
  my $fn = sprintf "%s/%04d.json", data_dir(), shift;
  retu
rn unless -e $fn;
  open my $fh, '<', $fn;
  my $text = <$fh>;
  my $hashref = decode_json $text or return;
  return %$hashref;
}

sub data_dir {
  file(__FILE__)->parent()->subdir('UN-data');  
}

1;

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.