Hi.. I am stuck from quite some days now.. Here s the scenario I have a main perl script and a self designed perl module called common.pm, in the module I have writen 3 subroutenes, 1st to connect to Sybase, 2nd calling a sybase proc with parameters and 3rd disconnecting from Sybase.. in my main perl script I am using this module with the help of ; use common.pm From the main perl script I am calling the subroutenes to connect to database.. &common::sybaseconnection(parameters) Now my problem is that I want to capture the error message thrown by a database say when the password has expired and the connection cannot be made in the perl script so that I can log that message in a log file. The errors thrown by the databse can be seen as ouput on the screen but I am unable to capture those error meaasges in my main perl script.. These are simple error messages which database would throw incase it was supplied with wrong user id password. Please help !!

In reply to Capturing error thrown by a database by puneet.keswani

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.