Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

STDIO handleing

by gemoroy (Beadle)
on May 10, 2009 at 07:43 UTC ( [id://763106]=perlquestion: print w/replies, xml ) Need Help??

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/

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://763106]
Approved by almut
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (1)
As of 2024-04-25 00:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found