From 25401fdf34e02a3026e2762c2a8c2f8d3b1db3b9 Mon Sep 17 00:00:00 2001 From: wajasu Date: Thu, 20 Sep 2012 16:38:36 -0500 Subject: [PATCH] Bug-8667 cleaned up perlcritic complaints, aligned usage with POD doc Content-Type: text/plain; charset="utf-8" http://bugs.koha-community.org/show_bug.cgi?id=8687 Signed-off-by: Kyle M Hall --- misc/cronjobs/overdue_notices.pl | 13 +++---------- 1 files 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.2.5