On Tue, Mar 06, 2001 at 08:38:31PM -0800, Colin Meyer wrote:
> DBI'ers:
>
> Is it possible to programmatically check on the success of a call to
> DBI->trace() or $h->trace()?
>
> For example, I'd like to know when I have called
> DBI->trace(1, '/file/that/I/cant/write/to.log').
>
> Experimentation (not documentation) shows that the return value of trace()
> seems to be the previous tracelevel rather than the usual true/false
> error indicator. When passed a logfile name that the program doesn't
> have write permissions for, trace seems to just write to STDERR, which
> isn't always desirable.
Ilya's suggestion is a good one.
The next version of the DBI will at least generate a warn()'ing that
can be caught using $SIG{__WARN__} if you need to.
Tim.