[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: Python or Perl for a Debian maintainance project?



Matthias Urlichs wrote:
> Julian Mehnle wrote:
> > That's true, but there's no reason not to use exceptions in Perl. 
> > They're even built-in, although you eccentrically (or shall I say,
> > exceptionally) raise them with `die`, and catch them with `eval {}`
> > -- and yes, that *is* efficient.  As syntactic sugar, you may want to
> > use the CPAN module "Error", though.
> 
> I thought so once, too. The problem is that this is not a standard Perl
> idiom,

This has already been answered, so I won't go into that any more.

> therefore it's not all that well tested,

What makes you think so?

> and lots of little niggly difficult-to-reproduce bugs (reference
> counting, error reporting, et al.), still lurk in the corners when you
> do any kind of non-local exit.

Aside from the fact that I have never had any problems with "eval { die() }" (nor heard of any), your statements begs for the question:  So, if Python's exception handling were having a bug, you would immediately recommend against using it?

> NB, a second problem is that eval{} catches everything. Usually,
> that's not what you want to do.

If you don't want to handle a certain exception, just re-raise it.  You may also want to have a look at the "Error" module (i.e. the liberror-perl package).  But others already pointed that out, too.



Reply to: