Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Exceptions and Return Codes

by MadraghRua (Vicar)
on Jun 30, 2001 at 03:19 UTC ( #92838=note: print w/replies, xml ) Need Help??

in reply to Exceptions and Return Codes

I have to agree with tilly and ichimonki, Carp is vital. Especially for CGI, where I always use Carp(fatalstobrowser).
Otherwise on subroutines if I'm piping back data, I tend to return an integer > 0 for error messages. Depending on the subroutine, I might have a range of error codes to return if I don't want the program to die there. You might try out page 348 of the Perl Cookbook, which has some suggestions on the undef, wantarray and return functions that you might find useful.
This link is also good for silly die messages, if you're in the mood.

yet another biologist hacking perl....

Replies are listed 'Best First'.
Re: Re: Exceptions and Return Codes
by merlyn (Sage) on Jun 30, 2001 at 09:34 UTC
    I sure hope you mean you use "fatalsToBrowser" for development only. Leaving it on in production code is a BIG SECURITY HOLE.

    -- Randal L. Schwartz, Perl hacker

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://92838]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2023-12-10 06:26 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (38 votes). Check out past polls.