From: merlyn@stonehenge.com (Randal L. Schwartz)
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org
Subject: Re: Perl gurus: why do we need Scalar::Util?
Date: 10 Jul 2006 06:28:49 -0700 [thread overview]
Message-ID: <86k66lsi5q.fsf@blue.stonehenge.com> (raw)
In-Reply-To: <Pine.LNX.4.63.0607101343060.29667@wbgn013.biozentrum.uni-wuerzburg.de>
>>>>> "Johannes" == Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Johannes> please do not let my die dumb: what is this "blessed" thing all about? And
Johannes> why do we need it in the private-Error.pm??
Ugh. Just took a peek for the first time at the "next" branch, and I see the
dangerous syntactic-sugar try { } catch { }. Sorry for not noticing that
earlier.
While that syntax looks like it would make things easier in theory, in
practice it is a source of leak-after-leak because it creates a closure for
the two blocks, and that can easily lead to a circular reference for
long-running tools. This would be of some concern if someone writes
a mod_perl module or a standalone webserver that doesn't exec itself
to clean up (which it shouldn't need).
So, if there's going to be rewrite, the first part would be to eliminate
the try { } catch { } sugar, and replace it with more traditional
exception catchers.
eval { };
if ($@) { ... }
Note that I'm *not* suggesting not to use Error.pm - that's a great
means by which to create hierarchical error classes that stringify nicely
and carry context on the error. I'm just saying to throw out the
try/catch syntax helper.
Sorry about that. If it's any consequence, we got it right in Perl 6. :)
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
next prev parent reply other threads:[~2006-07-10 13:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-10 11:44 Perl gurus: why do we need Scalar::Util? Johannes Schindelin
2006-07-10 13:00 ` Petr Baudis
2006-07-11 0:53 ` [PATCH] Eliminate Scalar::Util usage from private-Error.pm Petr Baudis
2006-07-11 1:38 ` Randal L. Schwartz
2006-07-11 1:40 ` Randal L. Schwartz
2006-07-11 1:42 ` Randal L. Schwartz
2006-07-11 1:57 ` Junio C Hamano
2006-07-11 3:38 ` Randal L. Schwartz
2006-07-10 13:28 ` Randal L. Schwartz [this message]
2006-07-10 14:29 ` Perl gurus: why do we need Scalar::Util? Petr Baudis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86k66lsi5q.fsf@blue.stonehenge.com \
--to=merlyn@stonehenge.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.