From 4e0d46e2d810f6fab7cccaf3852d988b94a9bac7 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Tue, 11 Feb 2014 14:39:41 +0100 Subject: [PATCH] invalidate tags after going through all reader This allows correct enter/leave events if more than one reader is connected to same computer --- lib/Biblio/RFID/Reader.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Biblio/RFID/Reader.pm b/lib/Biblio/RFID/Reader.pm index 13b8895..0ec702e 100644 --- a/lib/Biblio/RFID/Reader.pm +++ b/lib/Biblio/RFID/Reader.pm @@ -79,11 +79,11 @@ sub tags { } - foreach my $tag ( grep { $self->{_tags}->{$_}->{time} == 0 } keys %{ $self->{_tags} } ) { - $triggers->{leave}->( $tag ) if $triggers->{leave}; - $self->_invalidate_tag( $tag ); - } + } + foreach my $tag ( grep { $self->{_tags}->{$_}->{time} == 0 } keys %{ $self->{_tags} } ) { + $triggers->{leave}->( $tag ) if $triggers->{leave}; + $self->_invalidate_tag( $tag ); } warn "## _tags ",dump( $self->{_tags} ); -- 2.20.1