From 0b4bf2e5cf0a6bc56a83d71ce34a49066aeedcdc Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Fri, 10 Oct 2014 12:44:19 +0200 Subject: [PATCH] use DEBUG enviroment variable, update debug only if higher --- lib/Biblio/RFID.pm | 2 +- lib/Biblio/RFID/Reader.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Biblio/RFID.pm b/lib/Biblio/RFID.pm index 209956c..6cfa603 100644 --- a/lib/Biblio/RFID.pm +++ b/lib/Biblio/RFID.pm @@ -16,7 +16,7 @@ Biblio::RFID - perl tools to use different RFID readers for library use our $VERSION = '0.04'; -our $debug = 0; +our $debug = $ENV{DEBUG} || 0; =head1 DESCRIPTION diff --git a/lib/Biblio/RFID/Reader.pm b/lib/Biblio/RFID/Reader.pm index 5eb9417..f99d159 100644 --- a/lib/Biblio/RFID/Reader.pm +++ b/lib/Biblio/RFID/Reader.pm @@ -129,7 +129,7 @@ sub to_hash { sub debug { my ( $self, $level ) = @_; - $debug = $level; + $debug = $level if $level > $debug; warn "debug level $level\n" if $level; } -- 2.20.1