On Sat, Sep 12, 2009 at 02:39:48AM -0700, hmbr...@cvs.perl.org 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.

Reply via email to