Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Re: Style Point: Catching eval { } errors

by hardburn (Abbot)
on Nov 25, 2003 at 14:47 UTC ( #309913=note: print w/ replies, xml ) Need Help??


in reply to Re: Style Point: Catching eval { } errors
in thread Style Point: Catching eval { } errors

Good ideas can come from otherwise crappy languages. I think Java-style exception handling was a really good idea that Perl can almost (but not quite) do without using modules. With modules like Exception, you can get 90% of what Java has. You can get closer with Error, but it has other problems.

----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer

: () { :|:& };:

Note: All code is untested, unless otherwise stated


Comment on Re: Re: Style Point: Catching eval { } errors
Download Code
Re: Re: Re: Style Point: Catching eval { } errors
by glwtta (Hermit) on Nov 25, 2003 at 14:57 UTC
    You mentioned Error.pm having problems a couple of times - can you be a bit more specific about the particulars of these problems?

    I find myself using Error.pm quite a bit in web applications, and would be quite interested to know.

      This node puts it far better than I could.

      ----
      I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
      -- Schemer

      : () { :|:& };:

      Note: All code is untested, unless otherwise stated

Re: Re: Re: Style Point: Catching eval { } errors
by IlyaM (Parson) on Nov 25, 2003 at 15:41 UTC
    You can get closer with Error, but it has other problems.

    Given than Exception uses closures like Error I doubt it doesn't have these "other" problems too. The main problem is that currently the only way to add try/catch syntax to Perl without core changes it is to use closures what may cause memory leaks if you are not careful.

    --
    Ilya Martynov, ilya@iponweb.net
    CTO IPonWEB (UK) Ltd
    Quality Perl Programming and Unix Support UK managed @ offshore prices - http://www.iponweb.net
    Personal website - http://martynov.org

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://309913]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2015-07-03 17:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (55 votes), past polls