From f6362041d163b20efec36328d83d21fb4522f025 Mon Sep 17 00:00:00 2001 From: wajasu Date: Thu, 20 Sep 2012 16:38:36 -0500 Subject: [PATCH 2/2] Bug-8667 cleaned up perlcritic complaints, aligned usage with POD doc --- misc/cronjobs/overdue_notices.pl | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index 273b401..164c9fb 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -21,14 +21,6 @@ use strict; use warnings; -BEGIN { - - # find Koha's Perl modules - # test carefully before changing this - use FindBin; - eval { require "$FindBin::Bin/../kohalib.pl" }; -} - use Getopt::Long; use Pod::Usage; use Text::CSV_XS; @@ -56,7 +48,7 @@ overdue_notices.pl [ -n ] [ -library ] [ -library ...] -max maximum days overdue to deal with -library only deal with overdues from this library (repeatable : several libraries can be given) -csv populate CSV file - -html Output html to file + -html Output html to file directory or to STDOUT if none specified -itemscontent item information in templates -borcat category code that must be included -borcatout category code that must be excluded @@ -364,7 +356,8 @@ if ( defined $htmlfilename ) { $html_fh = *STDOUT; } else { my $today = DateTime->now(time_zone => C4::Context->tz ); - open $html_fh, ">:utf8",File::Spec->catdir ($htmlfilename,"notices-".$today->ymd().".html"); + my $htmlfile = File::Spec->catdir ($htmlfilename,"notices-".$today->ymd().".html"); + open $html_fh, ">:encoding(UTF-8)", $htmlfile or die "unable to open $htmlfile; $! (Be sure to create the directory)\n"; } print $html_fh "\n"; -- 1.7.12