gemoroy has asked for the wisdom of the Perl Monks concerning the following question:

Hi, monks! Again sorry for my bad english =) I'm using DBI::DBM and my script has such a logic:
... $sql->execute; if(check($sql->errstr) == 0){return 0;} switch ($i){...}
So..$sql->execute returns errstr and check() than takes it and parses it, and based on a parsing result returns a value..it works ok, but execute returns errstr value to STDOUT, but in some situations i dont want it to be printed. So..are there some ways of handling if STDOUT is accesed by a specific func?
Thanks a lot in advance!

Replies are listed 'Best First'.
Re: STDIO handleing
by almut (Canon) on May 10, 2009 at 08:11 UTC
      Or set RaiseError and catch the exception after an eval block. That's my favorite DBI trick.
        s/trick/treat/