Carp::nosigdie - needs a better name

2008-09-03 Thread Eric Wilhelm
Hi all, I found myself wanting to check whether some code had a $SIG{__DIE__} in it and realized I still had this silly module in my experiments directory. This throws an error whenever a $SIG{__DIE__} is assigned without a local(). Potentially useful in tests, or just via -M... (Yes,

Re: Carp::nosigdie - needs a better name

2008-09-03 Thread Austin Schutz
On Wed, Sep 03, 2008 at 12:29:01AM -0700, Eric Wilhelm wrote: package Carp::NoSigDie; use warnings; use strict; use Carp (); use overload '{}' = sub {sub {}}, fallback = 1; $SIG{__DIE__} = bless({}, __PACKAGE__); my $ended = 0; END {$ended = 1}; sub DESTROY { return

Re: Carp::nosigdie - needs a better name

2008-09-03 Thread Eric Wilhelm
# from Austin Schutz # on Wednesday 03 September 2008 11:41: From the code, I would have no idea what this does without a fair bit of perldoc-ing. How about some comments? bad bunny? Oh, so you want features? I'm not sure what constitutes a fair bit of documentation though =head1

Re: Carp::nosigdie - needs a better name

2008-09-03 Thread Eric Wilhelm
# from David Nicol # on Wednesday 03 September 2008 11:30: it could be documented as a suggested use case for Acme::Landmine Acme::landmine uses tie (on %SIG - does that work?) to blow up when the variable is accessed, but I only want to know when it is globally deleted. How does that work?

Re: Carp::nosigdie - needs a better name

2008-09-03 Thread Dave Rolsky
On Wed, 3 Sep 2008, Eric Wilhelm wrote: Acme::landmine uses tie (on %SIG - does that work?) to blow up when the Yes, tying %SIG is possible, and even tying entries in the %SIG hash. See Sig::PackageScoped for an entirely insane example.

Re: Carp::nosigdie - needs a better name

2008-09-03 Thread David Nicol
On Wed, Sep 3, 2008 at 3:12 PM, Eric Wilhelm [EMAIL PROTECTED] wrote: Also, as a debugging tool, I would rather be able to just load the module from a perl option. yes, absolutely. Until I saw your usage example I did not get how you use this handy tool. Since the localizing is the thing you

Re: Adding library inside cpan module

2008-09-03 Thread Austin Schutz
On Wed, Sep 03, 2008 at 10:56:00PM +0300, Shmuel Fomberg wrote: Hi All. I have this module on CPAN, Data::ParseBinary. now I want to add a library of pre-prepared format. For example, a parser/builder for BMP files. The question is, how do I call it? some options that I though about:

Re: Carp::nosigdie - needs a better name

2008-09-03 Thread Eric Wilhelm
# from David Nicol # on Wednesday 03 September 2008 13:29: Furthermore, you're enforcing a stricture, rather than enhancing Carp.  Here's a briefly considered suggestion:  perl -Mstrict::sigdie yourprogram.pl Maybe some day this will be a best practice:   use strict;   use strict::sig::die;