From: Dobrica Pavlinusic Date: Tue, 11 Feb 2014 13:39:41 +0000 (+0100) Subject: invalidate tags after going through all reader X-Git-Url: http://git.rot13.org/?p=Biblio-RFID.git;a=commitdiff_plain;h=4e0d46e2d810f6fab7cccaf3852d988b94a9bac7 invalidate tags after going through all reader This allows correct enter/leave events if more than one reader is connected to same computer --- 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} );