in reply to Switching between output to file and STDOUT
my $outfile; use Log::Log4perl qw(:easy); Log::Log4perl->easy_init( {level => $DEBUG, file => (defined $outfile ? $outfile : "STDOUT")}); DEBUG "hey!"; [download]