How to ask a question

Ovid on 2002-02-14T19:04:08

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?


My version of the module...

djberg96 on 2002-02-14T20:03:15

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;