Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Ovid (2709)

Ovid
  (email not shown publicly)
http://publius-ovidius.livejournal.com/
AOL IM: ovidperl (Add Buddy, Send Message)

Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.

Journal of Ovid (2709)

Thursday February 14, 2002
02:04 PM

How to ask a question

[ #2869 ]

Last night's Perl Monger's meeting went well. Austin Schutz has written a module that handles errors by having functions return undef on error (it should have a method call set, instead, IMHO) and pushes the error on the error stack. Nothing is written to STDERR, nothing dies, carps, croaks, confesses, or whines to you about what a miserable programmer you are. Instead, it's an interesting method of having trappable errors that let's the programmer decide how to handle the error.

One of the benefits of the meeting was chatting with a PhD chemist for Oregon Health Science University (OHSU). He can arrange for me to get a computer equipped classroom supplied to me for my "Camel Fishing" seminars. Well, that sucks. Now I actually have to pull this thing off :)

If I limit the class to five, I actually have enough people lined up to keep this thing going for months on end. However, there's been talk of a local support/mentoring group. Hmm... I think it's going to be easier to direct them to Perlmonks, the beginner's lists and even Usenet -- we all know how friendly the latter is to newbies, right? In that vein, it actually occurs to me that it would be a good idea to spend some time teaching them how to ask questions (I have Foo, I used Bar, I expected Baz, and got Qux). And not to reinvent wheels. Explain what cargo-cult is. Oh, and this is called "context". And these are problems with CGI parsing routines. And...

One day? How can I possible give 'em enough in one day?

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Austin Schutz has written a module that handles errors by having functions return undef on error

    Here's my quick & dirty (UNTESTED)

    package Smartass;

    BEGIN{
    use Exporter;
    my @sigs = keys(%SIG);
    push(@sigs,'__WARN__','__DIE__'); # Optional in lieu of 'eval'
    foreach(@sigs){ $SIG{$_} = sub{ return undef } }

    # For good measure
    *CORE::GLOBAL::die = sub{ return undef }
    *CORE::GLOBAL::warn = sub{ return undef }

    @EXPORT = qw(%SIG);
    }
    1;