in reply to Re: multiple perl-mysql queries...
in thread multiple perl-mysql queries...

Thanks, jeffa!

Does HandleError work with multiple error message types (e.g. Error connecting to database, Error retrieving records, etc)? In other words, for each error type, I want print out the appropriate error message when an error is encountered.

Replies are listed 'Best First'.
3Re: multiple perl-myslq queries...
by jeffa (Bishop) on Dec 04, 2003 at 14:54 UTC
    Just check the docs! :)
    "HandleError" (code ref, inherited)
       The "HandleError" attribute can be used to provide
       your own alternative behaviour in case of errors. If
       set to a reference to a subroutine then that
       subroutine is called when an error is detected (at the
       same point that "RaiseError" and "PrintError" are
       handled).
    
       The subroutine is called with three parameters: the
       error message string that "RaiseError" and
       "PrintError" would use, the DBI handle being used, and
       the first value being returned by the method that
       failed (typically undef).
    
       If the subroutine returns a false value then the
       "RaiseError" and/or "PrintError" attributes are
       checked and acted upon as normal.
    

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)