Handling error with exception

Ask a Question related to PERL Beginners, Design and Development.

  1. #1

    Default Handling error with exception

    Do perl have handling error (exception) mechanism?

    for example: java use : try{...} catch{...}

    Thanks
    Hari Fajri Guest

  2. Similar Questions and Discussions

    1. Global Exception Handling
      Exceptions thrown by an XML Web service method created using ASP.NET are sent back to the client in the form of a SOAP fault. A SOAP fault is a...
    2. PHP5 and exception handling
      Hello, I'm used to exception handling in C++ or Delphi/Object Pascal and I had lotsa expectations for PHP5 exception handling, especially since I...
    3. SoapExtension for Global Exception handling; but prevent exception from propagating!!
      Hi, I wrote a SoapExtension for Global Exception handling in Webservice and it works!!!! Now i want to catch the exception that happen in the...
    4. Exception Handling.
      Hi, Considering the scenario for handling exceptions in Web Application where we have Presentation layer, Business layer and Data Access layer; if...
    5. Exception handling problem
      I override protected void Application_Error(Object sender, EventArgs e) I have code that will read the last Exception message and redirect to a...
  3. #2

    Default Re: Handling error with exception

    On 2/12/2004 9:56 PM, Hari Fajri wrote:
    > Do perl have handling error (exception) mechanism?
    >
    > for example: java use : try{...} catch{...}
    perl has pretty poor build-in exception handling which consists of
    executing some code in an eval{...} block and then check $@ to see if an
    error occured. There are a couple of good modules that provide a very
    nice wrapper around the built-in mechanism. Probably the best is 'Error'
    which adds 'try', 'catch', and 'except' blocks. There are also
    Exception::Class, Exception and a bunch of others
    <http://search.cpan.org/search?query=exception>.

    Regards,
    Randy.


    Randy W. Sims Guest

  4. #3

    Default Re: Handling error with exception

    From: "Randy W. Sims" <RandyS@ThePierianSpring.org>
    > On 2/12/2004 9:56 PM, Hari Fajri wrote:
    >
    > > Do perl have handling error (exception) mechanism?
    > >
    > > for example: java use : try{...} catch{...}
    >
    > perl has pretty poor build-in exception handling
    I don't think "poor" is the right word. Simple or low-level would fit
    better. IMHO.
    > which consists of
    > executing some code in an eval{...} block and then check $@ to see if
    > an error occured.
    Considering the fact that $@ doesn't have to be a string, but it can
    be an object it's actually rather powerfull. But you do not have a
    lot of syntax sugar around that by default.
    > There are a couple of good modules that provide a
    > very nice wrapper around the built-in mechanism. Probably the best is
    > 'Error' which adds 'try', 'catch', and 'except' blocks. There are also
    > Exception::Class, Exception and a bunch of others
    > <http://search.cpan.org/search?query=exception>.
    Yep, in Perl you can choose your sweets :-)

    Jenda
    ===== [email]Jenda@Krynicky.cz[/email] === [url]http://Jenda.Krynicky.cz[/url] =====
    When it comes to wine, women and song, wizards are allowed
    to get drunk and croon as much as they like.
    -- Terry Pratchett in Sourcery

    Jenda Krynicky Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139