From: Rob Kinyon Date: Thu, 26 May 2005 14:57:07 +0000 (+0000) Subject: Will use 3-arg open(), if available X-Git-Tag: v0.25~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=64f0fd9a6b4c226919443ca6b8111f0cc225204f;p=p5sagit%2FExcel-Template.git Will use 3-arg open(), if available --- diff --git a/Changes b/Changes index fe6aff1..24e2d51 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ Revision history for Perl distribution Excel::Template +0.25 Thu May 26 11:00:00 2005 + - Changed how the template file is opened to use 3-arg open() if available + 0.24 Thu Mar 10 11:00:00 2005 - Implemented the KEEP_LEADING_ZEROS node - This wraps the keep_leading_zeros() worksheet method diff --git a/MANIFEST b/MANIFEST index ec69f69..5a3bd7b 100644 --- a/MANIFEST +++ b/MANIFEST @@ -70,6 +70,7 @@ t/019_output.t t/020_worksheet_attributes.t t/021_loop_error.t t/022_keep_leading_zeros.t +t/023_relative_values.t t/998_pod.t t/999_pod_coverage.t t/mock.pm diff --git a/META.yml b/META.yml index 2353c41..44e0930 100644 --- a/META.yml +++ b/META.yml @@ -1,7 +1,7 @@ # http://module-build.sourceforge.net/META-spec.html #XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# name: Excel-Template -version: 0.24 +version: 0.25 version_from: lib/Excel/Template.pm installdirs: site requires: diff --git a/lib/Excel/Template.pm b/lib/Excel/Template.pm index 1b686d1..2b3c45d 100644 --- a/lib/Excel/Template.pm +++ b/lib/Excel/Template.pm @@ -6,7 +6,7 @@ BEGIN { use Excel::Template::Base; use vars qw ($VERSION @ISA); - $VERSION = '0.24'; + $VERSION = '0.25'; @ISA = qw( Excel::Template::Base ); } @@ -202,9 +202,17 @@ sub parse_xml push @parms, Base => $dirname; - open( INFILE, "<$file" ) - || die "Cannot open '$file' for reading: $!\n"; - + eval q{ + open( INFILE, '<', $file ) + || die "Cannot open '$file' for reading: $!\n"; + }; if ( $@ ) { + if ( $@ =~ /Too many arguments for open/ ) { + open( INFILE, "< $file" ) + || die "Cannot open '$file' for reading: $!\n"; + } else { + die $@; + } + } } my $parser = XML::Parser->new( @parms );