example.pl untested

filter: Statementstmt 0.0% 0 / 22 Branchbran n/a Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 4 Podpod n/a totaltotal 0.0% 0 / 29 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 #!/usr/bin/perl
2  
3 use warnings;
4 use strict;
5 use lib 'lib';
6 use Log::Tiny;
7  
8 my $log = Log::Tiny->new('example.log', '%F %P %S (%-5c) %m%n') or die 'Could not log! (' . Log::Tiny->errstr . ')';
9 my ($warn, $error, $trace, $debug) = (0, 0, 0, 0);
10 $log->DEBUG("Starting...");
11 $debug++;
12 foreach ( 1 .. 5 ) {
13 $log->WARN( ++$warn );
14 $log->TRACE( ++$trace );
15 }
16 $log->DEBUG("Finishing...");
17 $debug++;
18  
19 print "debug $debug, warn $warn, trace $trace, error $error\n";
20