save to log only if we have it
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 4 Oct 2010 12:28:42 +0000 (14:28 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 4 Oct 2010 12:28:42 +0000 (14:28 +0200)
scripts/scan.pl

index dd281a7..0b59111 100755 (executable)
@@ -44,7 +44,7 @@ sub iso_date {
 
 sub log_tag {
        my $tag = shift;
-       return if $saved->{tag};
+       return if $saved->{tag} or ! $log;
        my $hash = Biblio::RFID::RFID501->to_hash( $rfid->blocks($tag) );
        open(my $fh, '>>', $log) || die "$log: $!";
        print $fh iso_date,",$tag,", $hash->{content}, "\n";