Skip Menu |

This queue is for tickets about the IO-Compress-Zlib CPAN distribution.

Report information
The Basics
Id: 42657
Status: resolved
Priority: 0/
Queue: IO-Compress-Zlib

People
Owner: Nobody in particular
Requestors: jpierce [...] cpan.org
Cc:
AdminCc:

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



Subject: Documentation error Re: instantiation failure
The dox claim that new returns undef, but it actually seems to throw an exception.
On Thu Jan 22 01:36:16 2009, JPIERCE wrote: Show quoted text
> The dox claim that new returns undef, but it actually seems to throw an > exception.
Can you give me an example of when it throws an exception please? cheers Paul
Subject: Re: [rt.cpan.org #42657] Documentation error Re: instantiation failure
Date: Sat, 24 Jan 2009 20:42:49 -0500
To: bug-IO-Compress-Zlib [...] rt.cpan.org
From: belg4mit [...] pthbb.org
When the file doesn't exist. To catch this case I had to do: $self{_fh} = eval { IO::Uncompress::Unzipnew($self{_file}) } || croak("TFF->$IO::Uncompress::Unzip::UnzipError: $self{_file}"); as an approximation of the idiom: open($self{_fh}, '<'.$self{_file}) || croak("TFF->$!: $self{_file}"); -- Free map of local environmental resources: http://CambridgeMA.GreenMap.org -- MOTD on Prickle-Prickle, the 24th of Chaos, in the YOLD 3175: Think of it as evolution in action --Oath of Fealty
On Sat Jan 24 20:42:57 2009, belg4mit@pthbb.org wrote: Show quoted text
> When the file doesn't exist. To catch this case I had to do: > > $self{_fh} = eval { IO::Uncompress::Unzipnew($self{_file}) } || > croak("TFF->$IO::Uncompress::Unzip::UnzipError: $self{_file}"); > > as an approximation of the idiom: > > open($self{_fh}, '<'.$self{_file}) || croak("TFF->$!: $self{_file}");
I don't get any exception that would warrant using eval for a non-existent file. $ perl -MIO::Uncompress::Unzip -e '$a = new IO::Uncompress::Unzip "nofile" or die "error is '$!'\n"' error is 'No such file or directory' Do you get something different when you run that? Paul
Subject: Re: [rt.cpan.org #42657] Documentation error Re: instantiation failure
Date: Sun, 25 Jan 2009 15:16:09 -0500
To: bug-IO-Compress-Zlib [...] rt.cpan.org
From: belg4mit [...] pthbb.org
Not from the command-line, but I do in my module. In it I see: IO::Uncompress::Unzip: input filename is undef or null string at lib/Text/FIGlet/Font.pm line 38 Which is slightly different from the file not existing, except that CORE::open handles them the same. -- Free map of local environmental resources: http://CambridgeMA.GreenMap.org -- MOTD on Setting Orange, the 25th of Chaos, in the YOLD 3175: Learn to live simply so that other beings may simply live.
On Sun Jan 25 15:47:37 2009, belg4mit@pthbb.org wrote: Show quoted text
> Not from the command-line, but I do in my module.
It shouldn't matter. The behaviour of code should be identical on the command line and in a module. Show quoted text
> In it I see: > > IO::Uncompress::Unzip: input filename is undef or null string at > lib/Text/FIGlet/Font.pm line 38 > > Which is slightly different from the file not existing, except that > CORE::open handles them the same.
Aaah ok, I see your problem now. That particular message comes from a croak in my code. Let me see if I can downgrade that croak into a standard $! type error. For your module, unless you specify the version of my module with the fix in it, you will have to keep the eval in place. Paul