Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Tracking down "uninitialized value" errs

by nite_man (Deacon)
on Jul 30, 2003 at 09:21 UTC ( #279124=note: print w/replies, xml ) Need Help??


in reply to Tracking down "uninitialized value" errs

You can use try/catch block from module Error (look at examles in the module documentation and in the article Object Oriented Exception Handling in Perl).

About strange error messages, try to look at perldelta (Perl 5.6.1)::Improved diagnostics.

Hope I helped.
      
--------------------------------
SV* sv_bless(SV* sv, HV* stash);

Replies are listed 'Best First'.
Re: Tracking down "uninitialized value" errs
by Abigail-II (Bishop) on Jul 30, 2003 at 10:49 UTC
    Could you elaborate on your suggestion? From reading the documentation of the Error module, and the article you pointed to, it isn't clear to me at all how the Error module could help in catching warnings from already written code.

    From what I understood is that the Error module provides you a frame work to set up your own exception handling mechanism, where you can throw exceptions and catch them. Which is something completely different from what the OP wants to do.

    Abigail

      Generally, you are right, but, in my mind, this problem was because there were not defined some values in the programm. So, using catch of exeptions can help to know, where undefined data were used and corrected them.

      _ _ _ _ _ _
        M i c h a e l

        How so? Use of an uninitialized value in Perl is not an exception. Perl will issue a warning, and then continue.

        Abigail

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://279124]
help
Chatterbox?
[tye]: because s/// doesn't support an 'r' option?
[tye]: (in your version of Perl?)
[tye]: no, thankfully (at least my version of Perl) has a different error for that.
[tye]: could be an unclosed m//, qr//, s///, or even q// (etc.) from earlier

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2016-12-07 18:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (131 votes). Check out past polls.