RFID-Base
view release on metacpan or search on metacpan
lib/RFID/Reader.pm view on Meta::CPAN
specific reader, consult its documentation.
=cut
use strict;
use warnings;
use Carp;
# Prototype
sub uniq(&@);
sub _init
{
my $self = shift;
if ($ENV{RFID_DEBUG})
{
warn "Turning on debugging.\n";
$self->set(Debug => $ENV{RFID_DEBUG});
}
lib/RFID/Reader.pm view on Meta::CPAN
}
# Utility Functions
sub sortcmp
{
my $sub = shift;
local($a,$b)=@_;
$sub->();
}
sub uniq(&@)
{
my($cmpsub, @list)=@_;
my $last = shift @list
or return ();
my @ret =($last);
foreach (@list)
{
push(@ret,$_)
unless sortcmp($cmpsub,$_,$last)==0;
$last = $_;
( run in 1.504 second using v1.01-cache-2.11-cpan-49f99fa48dc )