Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CGI CPAN distribution.

Report information
The Basics
Id: 49296
Status: resolved
Priority: 0/
Queue: CGI

People
Owner: MARKSTOS [...] cpan.org
Requestors: Rhubbell [...] iHubbell.com
Cc:
AdminCc:

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



Subject: CGI::Carp - problem with using an in-memory target for STDERR logging
Date: Mon, 31 Aug 2009 12:52:00 -0700
To: bug-CGI.pm [...] rt.cpan.org
From: rhubbell <Rhubbell [...] iHubbell.com>
I tried to sort this out but gave up after I noticed I was giggling hysterically. Sort of like Inspector Clouseau's boss. open(ELOG, '>', \$mystderr); carpout(ELOG); perldoc -f fileno says: ... (Filehandles connected to memory objects via new features of "open" may return undefined even though they are open.) Seems fileno is deeply implicated in doing IO I also found PerlIO::scalar. Maybe my expectations should be lowered and I need a pro forma explanation. Or maybe I'm just doing something incorrectly. FWIW, in the meantime, I am just not using CGI::Carp and I have opened STDERR to \$mystderr and all is well and the gigglins has subsided.
On Mon Aug 31 15:52:27 2009, Rhubbell@iHubbell.com wrote: Show quoted text
> > I tried to sort this out but gave up after I noticed I was giggling > hysterically. Sort of like Inspector Clouseau's boss. > > open(ELOG, '>', \$mystderr); > carpout(ELOG);
I'm sorry, I'm not clear what has happened that is different than your expections. Did the two lines above not behave as you expected? Mark
Subject: Re: [rt.cpan.org #49296] CGI::Carp - problem with using an in-memory target for STDERR logging
Date: Mon, 31 Aug 2009 13:00:55 -0700
To: bug-CGI.pm [...] rt.cpan.org
From: rhubbell <Rhubbell [...] iHubbell.com>
On Mon, 31 Aug 2009 15:56:39 -0400 MARKSTOS via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=49296 > > > On Mon Aug 31 15:52:27 2009, Rhubbell@iHubbell.com wrote:
> > > > I tried to sort this out but gave up after I noticed I was giggling > > hysterically. Sort of like Inspector Clouseau's boss. > > > > open(ELOG, '>', \$mystderr); > > carpout(ELOG);
> > I'm sorry, I'm not clear what has happened that is different than your > expections. Did the two lines above not behave as you expected?
Hi, Your read-back is correct, I was unable to get those events, normally written to STDERR, to get to $mystderr. CGI::Carp complained that it was unable to dupe STDERR. I believe that because fileno returns undef for the in-memory open target. Show quoted text
> > Mark >
I now have a patch in my git repo which documents that carpout() does not work with in-memory file handles. A patch for a better solution would be welcome however.
Subject: Thanks, released
The patch for this ticket has now been released in CGI.pm 3.47, and this ticket is considered resolved. Thanks again for you help to improve CGI.pm! Mark