Author: hmbrand
Date: Fri Sep 18 03:37:55 2009
New Revision: 13366
Modified:
dbi/trunk/lib/DBI/PurePerl.pm
Log:
The pure-perl fix for DBI->trace (1, *FOO)
Modified: dbi/trunk/lib/DBI/PurePerl.pm
==============================================================================
--- dbi/trunk/lib/DBI/PurePerl.pm (original)
+++ dbi/trunk/lib/DBI/PurePerl.pm Fri Sep 18 03:37:55 2009
@@ -562,6 +562,12 @@
$DBI::tfh_needs_close = 0;
return 1;
}
+ if ($file && ref \$file eq 'GLOB') {
+ $DBI::tfh = *{$file}{IO};
+ select((select($DBI::tfh), $| = 1)[0]);
+ $DBI::tfh_needs_close = 0;
+ return 1;
+ }
$DBI::tfh_needs_close = 1;
if (!$file || $file eq 'STDERR') {
open $DBI::tfh, ">&STDERR" or carp "Can't dup STDERR: $!";