pricecharts

track prices of consumer electronics
Log | Files | Refs | README

commit cdcafb8548c9ee54734f6c376253f9425d473ae4
parent b3b92805d98adbdf83ed3c06162f8effd46fd226
Author: Kyle Milz <kyle@getaddrinfo.net>
Date:   Sat, 28 Feb 2015 18:04:37 -0700

PriceChart: add error checks for get_log

Diffstat:
MPriceChart.pm | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/PriceChart.pm b/PriceChart.pm @@ -111,9 +111,11 @@ sub new_ua sub get_log { my $file = shift; - my $verbose = shift; + my $verbose = shift || 0; my $log_dir = "/var/www/logs/pricechart"; + return undef unless defined $file; + if ($verbose) { open my $log, '>&', STDOUT or die "$!"; return $log;