From e97d4f976e252c2ee65ac76dc8b4b65962c964f3 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 30 Nov 2006 15:01:49 +0000 Subject: make enough changes so that perl_chcker run smoothly --- iurt2 | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/iurt2 b/iurt2 index 964b8a0..cb6ef0b 100755 --- a/iurt2 +++ b/iurt2 @@ -161,8 +161,9 @@ $run{todo} = []; "Log file.", sub { $run{log} = pop @_; - open $run{LOG}, ">$run{log}" or die "unable to open $run{log}\n"; - print *{$run{LOG}}, "command line: @ARGV\n"; + open my $log, ">$run{log}" or die "unable to open $run{log}\n"; + $run{LOG} = sub { print $log @_ }; + print *$log, "command line: @ARGV\n"; 1; }, "Log file" ], [ "m", "media", -1, " ... ", @@ -254,7 +255,7 @@ $run{todo} = []; ); open(my $LOG, ">&STDERR"); -$run{LOG} = $LOG; +$run{LOG} = sub { print $LOG @_ }; print "$program_name version $VERSION\n"; #plog_init($program_name, $LOG, $run{verbose}, 1); @@ -278,7 +279,7 @@ my $configfile = "$HOME/.iurt.$run{distro_tag}.conf"; plog('DEBUG', "load config: $configfile"); my $config; if (-f $configfile) { - $config = do $configfile + $config = eval(cat_($configfile)) or die "FATAL $program_name: syntax error in $configfile"; } else { $config = {}; @@ -478,7 +479,7 @@ my $clear_cache = 1; if (-f $cachefile && $run{use_cache}) { plog('INFO', "loading cache file $cachefile"); - $cache = do $cachefile + $cache = eval(cat_($cachefile)) or plog('ERR', "FATAL: could not load cache $cachefile ($!)"); if (!$cache) { @@ -494,7 +495,7 @@ if (-f $cachefile && $run{use_cache}) { } plog('NOTIFY', "loading alternate cache file $cachefile"); - $cache = do $cachefile + $cache = eval(cat_($cachefile)) or plog('ERR', "FATAL: could not load cache $cachefile ($!)"); } $clear_cache = 0 if $cache; -- cgit v1.2.1