X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=lib%2FRFID%2FBiblio.pm;h=88014a41199c4aa807699d464428c933de19927f;hb=4dee69b23eb8e5feda0984e447ad0d7a1e1d54d3;hp=daccc32b43e483eca76141eacd63c98d23c7e411;hpb=c9c7cf200fae07daa8423ca303b619f0ca554343;p=Biblio-RFID.git diff --git a/lib/RFID/Biblio.pm b/lib/RFID/Biblio.pm index daccc32..88014a4 100644 --- a/lib/RFID/Biblio.pm +++ b/lib/RFID/Biblio.pm @@ -4,7 +4,7 @@ use warnings; use strict; use base 'Exporter'; -our @EXPORT = qw( hex2bytes as_hex hex_tag ); +our @EXPORT = qw( hex2bytes as_hex hex_tag $debug ); use Data::Dump qw(dump); @@ -16,7 +16,7 @@ RFID::Biblio - perl tools to use different RFID readers for library use our $VERSION = '0.02'; -my $debug = 0; +our $debug = 0; =head1 DESCRIPTION @@ -56,6 +56,9 @@ C is jQuery based JavaScript code which can be inserted in Koha Library System to provide overlay with tags in range and check-in/check-out form-fill functionality. +Applications can use L which is some kind of +semi-standard 3M layout or blocks on RFID tags. + =for readme stop =head1 EXPORT @@ -105,6 +108,24 @@ sub as_hex { sub hex_tag { uc(unpack('H16', shift)) } +=head1 WARN + +We are installing L handler to controll debug output +based on C<$Biblio::RFID::debug> level + +=cut + +BEGIN { + $SIG{'__WARN__'} = sub { + my $msg = join(' ', @_); + if ( $msg =~ m/^(#+)/ ) { + my $l = length $1; + return if $l > $debug; + } + warn join(' ', @_); + } +} + =for readme continue =head1 HARDWARE SUPPORT @@ -126,6 +147,8 @@ L Dobrica Pavlinusic, C<< >> +L + =head1 BUGS Please report any bugs or feature requests to C, or through