/usr/bin/perl
=head1 NAME
RFID-JSONP-server - simpliest possible JSONP server which provides local web interface to RFID readers
=head1 USAGE
./scripts/RFID-JSONP-server.pl [--debug] [--listen=1
27.0.0.1:9000] [--reader=filter]
=cut
use strict;
use warnings;
use Data::Dump qw/dump/;
use JSON::XS;
use IO::Socket::INET;
use LWP::UserAgent;
use URI;
use URI::Escape;
use POSIX qw(strftime);
u
our $rfid_sid_cache;
sub rfid_borrower {
my $hash = shift;
if ( my $json = $rfid_sid_cache->{ $hash->{sid} } ) {
return $json;
}
my $ua = LWP::UserAgent->new;
my $url = URI->new( $koha_url . '