Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Excel-Writer-XLSX CPAN distribution.

Report information
The Basics
Id: 73424
Status: resolved
Priority: 0/
Queue: Excel-Writer-XLSX

People
Owner: Nobody in particular
Requestors: YuvalL [...] hicapital.co.il
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: stdout not working with '-' filename
Date: Thu, 22 Dec 2011 13:02:35 +0000
To: "bug-Excel-Writer-XLSX [...] rt.cpan.org" <bug-Excel-Writer-XLSX [...] rt.cpan.org>
From: éåáì ìéáøîï <YuvalL [...] hicapital.co.il>
using Excel-Writer-XLSX-0.43 on perl 5.8.8 the following: Spreadsheet::WriteExcel->new("-") returns undef, without error in $! the following works: binmode( STDOUT ); my $workbook = Excel::Writer::XLSX->new(\*STDOUT);
On Thu Dec 22 08:02:51 2011, YuvalL@hicapital.co.il wrote: Show quoted text
> using Excel-Writer-XLSX-0.43 > on perl 5.8.8 > > the following: > Spreadsheet::WriteExcel->new("-") > returns undef, without error in $! > > the following works: > binmode( STDOUT ); > my $workbook = Excel::Writer::XLSX->new(\*STDOUT);
Hi, Thanks for that. It is probably due to the way Archive::Zip handles filenames/filehandles, or my usage of it. As an aside I wonder if people even know about the special file handle "-" these days. Anyway, I'll add a fix for it in the next release. John. --
On Fri Dec 23 06:34:50 2011, JMCNAMARA wrote: Show quoted text
> > As an aside I wonder if people even know about the special file handle > "-" these days.
I ran into the same behavior, and in looking at Excel::Writer::XLSX::Workbook::new(), I think the problem is that the output file is ultimately created via 3-arg CORE::open() ( via IO::File->new($self->{_filename},'w') ), and the '>-'-for-STDOUT magic applies only to 2-arg CORE::open(). If you want to preserve the special behavior of '-' documented in E::W::X, there's probably no pressing reason that it would be bad to spot a filename of '-' in new() and special-case it to a 2-arg open (or even just \*STDOUT). I hope this is helpful.
On Tue Jan 03 19:05:31 2012, CBAIL wrote: Show quoted text
> > If you want to preserve the special behavior of '-' documented in > E::W::X, there's probably no pressing reason that it would be bad to > spot a filename of '-' in new() and special-case it to a 2-arg open (or > even just \*STDOUT).
Hi Charles, Yes, that was the way I was thinking. For backwards compatibility I probably just make '-' a special case. I may de-emphasise it in the docs though. John. --
On Thu Dec 22 08:02:51 2011, YuvalL@hicapital.co.il wrote: Show quoted text
> using Excel-Writer-XLSX-0.43 on perl 5.8.8 the following: > Spreadsheet::WriteExcel->new("-") > returns undef, without error in $!
Hi Yuval, I've put a fix for this into version 0.44 of Excel::Writer::XLSX. Can you test it when you get a chance and let me know if I can close this issue. Regards, John. --
Subject: RE: [rt.cpan.org #73424] stdout not working with '-' filename
Date: Thu, 5 Jan 2012 11:24:47 +0000
To: "'bug-Excel-Writer-XLSX [...] rt.cpan.org'" <bug-Excel-Writer-XLSX [...] rt.cpan.org>
From: יובל ליברמן <YuvalL [...] hicapital.co.il>
Tested version 0.44 Its working Thanks! Show quoted text
-----Original Message----- From: John McNamara via RT [mailto:bug-Excel-Writer-XLSX@rt.cpan.org] Sent: Thursday, January 05, 2012 12:46 PM To: יובל ליברמן Subject: [rt.cpan.org #73424] stdout not working with '-' filename <URL: https://rt.cpan.org/Ticket/Display.html?id=73424 > On Thu Dec 22 08:02:51 2011, YuvalL@hicapital.co.il wrote:
> using Excel-Writer-XLSX-0.43 on perl 5.8.8 the following: > Spreadsheet::WriteExcel->new("-") > returns undef, without error in $!
Hi Yuval, I've put a fix for this into version 0.44 of Excel::Writer::XLSX. Can you test it when you get a chance and let me know if I can close this issue. Regards, John. --
That's great. Thanks for the report. John. --