Re: Error.pm and DBI.pm problem

From: Anno Siegel (anno4000_at_lublin.zrz.tu-berlin.de)
Date: 10/10/04

  • Next message: Anno Siegel: "Re: Top 10 list algorithm"
    Date: 10 Oct 2004 12:43:57 GMT
    
    

    Horst Walter <unkwb@web.de> wrote in comp.lang.perl.misc:

    Don't top-post. I have moved your reply where it belongs, after what
    you are replying to,

    > peter@PSDT.com (Peter Scott) wrote in message
    > news:<x8b9d.17813$a41.15681@pd7tw2no>...
    > > In article <53867fbe.0410060715.7948a734@posting.google.com>,
    > > unkwb@web.de (Horst Walter) writes:

    > > >Yes, this is what I have guessed. But I tried many things and was not
    > > >able to do it.
    > > >
    > > >I used
    > > >use Error qw(:try);
    > > >
    > > >as in all the examples for error.pm. I have tried several tings as
    > > >use Error qw(:try with);
    > > >
    > > >but none of them worked.
    > > >It would be great if somebody had an example on this.
    > >
    > > Post the shortest *complete program* you can construct that
    > > demonstrates the problem please. I have never had problems
    > > with Error.pm and DBI and cannot reproduce your problem.

    > sub oracleLogoff ($) {
    > my ($dbh) = @_;
    > if (!defined $dbh) {
    > return;
    > }
    >
    > # avoid any trouble during close
    > try {
    > $dbh->disconnect;
    > } catch Error with {
    > # ignore the error
    > };
    > }
    >
    >
    > Error
    > Error: Can't call method "with" without a package or object reference
    > at autodb.pm line 181. ("catch Error with") line

    That is *not* a complete program. A complete program is one that can
    be copied and pasted into a file and run. In particular, yours doesn't
    show how you load the Errors module.

    Have you read the documentation of Errors.pm? Especially what it says
    about an export tag named ":try"?

    Anno


  • Next message: Anno Siegel: "Re: Top 10 list algorithm"

    Relevant Pages