Re: [svn:dbi] r13312 - dbi/trunk

Tim Bunce <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase.devel
Message-ID <[email protected]>
On Sat, Sep 12, 2009 at 02:39:48AM -0700, [email protected] wrote:
> Author: hmbrand
> Date: Sat Sep 12 02:39:44 2009
> New Revision: 13312
> 
> Modified:
>    dbi/trunk/DBI.xs
> 
> Log:
> perl-5.10.x sets filename to "*main::STDERR" when using 'DBI->trace (0, *STDERR);'
> 
> Modified: dbi/trunk/DBI.xs
> ==============================================================================
> --- dbi/trunk/DBI.xs	(original)
> +++ dbi/trunk/DBI.xs	Sat Sep 12 02:39:44 2009
> @@ -814,7 +814,8 @@
>      else {
>  	filename = (SvOK(file)) ? SvPV_nolen(file) : Nullch;
>  	/* undef arg == reset back to stderr */
> -	if (!filename || strEQ(filename,"STDERR")) {
> +	if (!filename || strEQ(filename,"STDERR")
> +		      || strEQ(filename,"*main::STDERR")) {
>  	    close_trace_file(aTHX);
>  	    DBILOGFP = PerlIO_stderr();

Wouldn't it be better to detect when a glob is being passed and use the
filehandle in the glob? That way it would work for any *FOO fh.

Tim.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.