X-Git-Url: http://git.rot13.org/?p=Biblio-RFID.git;a=blobdiff_plain;f=lib%2FRFID%2FBiblio%2FReader.pm;h=f5e6fd413d164fea2242ef2cd50e4762fd680d23;hp=5d186e13e9dec1219c41b220e2d3f010e75aeaaa;hb=85092c9643bc97fbacab4113f1de90311c00e37d;hpb=ec0e32fbd3b70ff94eb01c729f766b797264315f diff --git a/lib/RFID/Biblio/Reader.pm b/lib/RFID/Biblio/Reader.pm index 5d186e1..f5e6fd4 100644 --- a/lib/RFID/Biblio/Reader.pm +++ b/lib/RFID/Biblio/Reader.pm @@ -1,4 +1,4 @@ -package RFID::Biblio::Reader; +package Biblio::RFID::Reader; use warnings; use strict; @@ -6,22 +6,23 @@ use strict; use Data::Dump qw(dump); use Time::HiRes; use lib 'lib'; -use RFID::Biblio; +use Biblio::RFID; +use Carp qw(confess); =head1 NAME -RFID::Biblio::Reader - simple way to write RFID applications in perl +Biblio::RFID::Reader - simple way to write RFID applications in perl =head1 DESCRIPTION This module will probe all available readers and use calls from -L to invoke correct reader. +L to invoke correct reader. =head1 FUNCTIONS =head2 new - my $rfid = RFID::Biblio::Reader->new( 'optional reader filter' ); + my $rfid = Biblio::RFID::Reader->new( 'optional reader filter' ); =cut @@ -99,8 +100,8 @@ sub tags { =cut -sub blocks { $_[0]->{_tags}->{$_[1]}->{ 'blocks' } || die "no blocks for $_[1]"; }; -sub afi { $_[0]->{_tags}->{$_[1]}->{ 'afi' } || die "no afi for $_[1]"; }; +sub blocks { $_[0]->{_tags}->{$_[1]}->{ 'blocks' } || confess "no blocks for $_[1]"; }; +sub afi { $_[0]->{_tags}->{$_[1]}->{ 'afi' } || confess "no afi for $_[1]"; }; =head1 PRIVATE @@ -122,7 +123,7 @@ sub _invalidate_tag { Probe each RFID reader supported and returns succefull ones - my $rfid_readers = RFID::Biblio::Reader->_available( $regex_filter ); + my $rfid_readers = Biblio::RFID::Reader->_available( $regex_filter ); =cut @@ -139,7 +140,7 @@ sub _available { foreach my $reader ( @readers ) { next if $filter && $reader !~ /$filter/i; - my $module = "RFID::Biblio::Reader::$reader"; + my $module = "Biblio::RFID::Reader::$reader"; eval "use $module"; die $@ if $@; if ( my $rfid = $module->new ) { @@ -188,9 +189,9 @@ __END__ =head2 RFID reader implementations -L +L -L +L -L +L