Re: exception handling

2014-02-14 Thread 'lesleyb'
of this. Is there some way I should be wrapping calls to the shared lib in something like an eval BLOCK, so I can croak a message back to the web page? perldoc -q exception turned up a result from perlfaq8 just so you know the tools for exception handling are there. You might be able to catch the exception

exception handling

2014-02-13 Thread Bill McCormick
I have a Perl module that calls a function from in a Swig generated module, which in turn calls a function in a shared library. It's been a while since I put it all together and made it work, so I'm kind of hazy on the technical details - and since it mostly works I never need to look at it.

Help on exception handling (Try::Tiny)

2013-10-04 Thread Shaji Kalidasan
Dear Perlers, I am trying to figure out the flow of a try catch block after executing the 'next' statement. In the try statement after illegal division by zero the program flow reaches catch block and then executes the 'next' statement. After executing the next statement the control flow has

Re: Help on exception handling (Try::Tiny)

2013-10-04 Thread Jim Gibson
On Oct 4, 2013, at 3:36 AM, Shaji Kalidasan wrote: Dear Perlers, I am trying to figure out the flow of a try catch block after executing the 'next' statement. In the try statement after illegal division by zero the program flow reaches catch block and then executes the 'next' statement.

Re: Help on exception handling (Try::Tiny)

2013-10-04 Thread Shaji Kalidasan
. --- From: Andy Bach afb...@gmail.com To: Shaji Kalidasan shajiin...@yahoo.com Sent: Friday, 4 October 2013 10:23 PM Subject: Re: Help on exception handling (Try::Tiny) On Fri, Oct 4

Exception Handling in perl

2009-02-27 Thread Sarsamkar, Paryushan
Hi All, Can we handle exceptions in PERL programs? For example - Here if it fails to copy then can I handle the exception and perform the next steps in my script? I tried removing die but then it does not complain and I wont be able to come to know if that is copied or not. (Is there

Re: Exception Handling in perl

2009-02-27 Thread David Shere
On Fri, 2009-02-27 at 08:41 -0500, Sarsamkar, Paryushan wrote: copy (C:\\build.xml,D:\\build.xml) or die Cannot copy : $!; simplest (?) solution: copy (C:\\build.xml,D:\\build.xml) or print Cannot copy : $!; You can also have it do more than one thing: copy (C:\\build.xml,D:\\build.xml) or (

Re: Exception Handling in perl

2009-02-27 Thread David Shere
On Fri, 2009-02-27 at 08:49 -0500, David Shere wrote: You can also have it do more than one thing: copy (C:\\build.xml,D:\\build.xml) or ( print Cannot copy : $! and somethingElse() ); Or you can have more fun: unless (copy (C:\\build.xml,D:\\build.xml)) { print Cannot copy : $!;

RE: Exception Handling in perl

2009-02-27 Thread Sarsamkar, Paryushan
Thanks... My bad... I did not realize to use print instead of just dieing :) Thanks, Paryushan -Original Message- From: David Shere [mailto:dsh...@steelerubber.com] Sent: Friday, February 27, 2009 7:31 PM To: Sarsamkar, Paryushan Cc: beginners@perl.org Subject: Re: Exception Handling

Re: Exception Handling in perl

2009-02-27 Thread Jenda Krynicky
Subject:Re: Exception Handling in perl From: David Shere dsh...@steelerubber.com To: Sarsamkar, Paryushan psars...@ptc.com Copies to: beginners@perl.org Date sent: Fri, 27 Feb 2009 09:00:41 -0500 On Fri, 2009-02-27

Exception handling in perl

2007-07-12 Thread Pushkar Pande
How do we handle exceptions in perl?

Re: Exception handling in perl

2007-07-12 Thread Martin Barth
On Thu, 12 Jul 2007 16:06:27 +0530 Pushkar Pande [EMAIL PROTECTED] wrote: How do we handle exceptions in perl? there is a Error.pm in CPAN, which allows you to write code like that try { something(); } catch Error with { code(); }otherwise{ foobar(); }; -- To

Re: Exception handling in perl

2007-07-12 Thread Mr. Shawn H. Corey
Pushkar Pande wrote: How do we handle exceptions in perl? perldoc -f eval Example: eval { some code }; if( $@ ){ # an exception occurred } -- Just my 0.0002 million dollars worth, Shawn For the things we have to learn before we can do them, we learn by doing them. Aristotle

Re: Exception handling in perl

2007-07-12 Thread Ovid
- Original Message From: Pushkar Pande [EMAIL PROTECTED] How do we handle exceptions in perl? If you want *proper* exception handling (exception objects, try/catch, stack traces, etc), the don't use: die $message; return 0; eval {}; # except with exception objects $SIG

XML::Twig exception handling

2005-06-03 Thread Peter Rabbitson
Hello, I am interfacing an XML file with a database, much like the last example at http://www.xmltwig.com/xmltwig/tutorial/yapc_twig_s5.html What I am actually doing is checking if the table already got such a record, if so - updating it, otherwise inserting it, but this is not relevant.

Re: XML::Twig exception handling

2005-06-03 Thread Peter Rabbitson
Either way I can't figure out how to raise an exception in the insert_row subroutine so that the parsefile() will die as well. Since I am working with records totalling several gigabytes, I am checking every SQL operation by evaling them with RaiseError turned on. This doesn't help me much,

Re: Exception Handling - Professionally

2004-06-10 Thread drieux
, then it would know that it needed to deal with what ever the errno was... One part of the problem here is 'getting the exception handling' into the process so that there are enough 'error message indicators' to assert what went wrong, and hopefully where. But the b-side of that would be working out

Re: Exception Handling - Professionally

2004-06-10 Thread Peter Scott
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Randal L. Schwartz) writes: Drieux == Drieux [EMAIL PROTECTED] writes: Drieuxif ( ref($got_back) eq Foo::Bar) No no no. Stop using ref(). It means you can't replace it with a subclass of it. You want (and I show in my still-hidden

Re: Exception Handling - Professionally

2004-06-10 Thread Scott Stearns
On 08 Jun 2004, you wrote in perl.beginners: Greetings, For you professional Perl programmers: how do you approach exception-handling in the your world? I know there are a lot of ways Perl gives us to do this: basic 'die', eval'ing blocks of code and the Exception.pm module

Re: Exception Handling - Professionally

2004-06-09 Thread drieux
On Jun 8, 2004, at 11:34 AM, Scott Stearns wrote: [..] For you professional Perl programmers: how do you approach exception-handling in the your world? I know there are a lot of ways Perl gives us to do this: basic 'die', eval'ing blocks of code and the Exception.pm module but is there a standard

Re: Exception Handling - Professionally

2004-06-09 Thread Randal L. Schwartz
Drieux == Drieux [EMAIL PROTECTED] writes: Drieux if ( ref($got_back) eq Foo::Bar) No no no. Stop using ref(). It means you can't replace it with a subclass of it. You want (and I show in my still-hidden article); if (UNIVERSAL::isa($got_back, Foo::Bar)) { ... } -- Randal

Re: Exception Handling - Professionally

2004-06-09 Thread Wiggins d Anconia
On Jun 8, 2004, at 11:34 AM, Scott Stearns wrote: [..] For you professional Perl programmers: how do you approach exception-handling in the your world? I know there are a lot of ways Perl gives us to do this: basic 'die', eval'ing blocks of code and the Exception.pm module

Exception Handling - Professionally

2004-06-08 Thread Scott Stearns
Greetings, For you professional Perl programmers: how do you approach exception-handling in the your world? I know there are a lot of ways Perl gives us to do this: basic 'die', eval'ing blocks of code and the Exception.pm module but is there a standard in the real world for handling exceptions

Re: Exception Handling - Professionally

2004-06-08 Thread Wiggins d Anconia
Greetings, For you professional Perl programmers: how do you approach exception-handling in the your world? I know there are a lot of ways Perl gives us to do this: basic 'die', eval'ing blocks of code and the Exception.pm module but is there a standard in the real world for handling

Re: Exception Handling - Professionally

2004-06-08 Thread Randal L. Schwartz
Scott == Scott Stearns [EMAIL PROTECTED] writes: Scott For you professional Perl programmers: how do you approach Scott exception-handling in the your world? I know there are a lot of Scott ways Perl gives us to do this: basic 'die', eval'ing blocks of Scott code and the Exception.pm module

how-to: custom exception handling?

2003-11-05 Thread Shaun Fryer
I'd like to setup customised exception handling, but am unsure how to impliment it. I started by reading `perldoc -f die` and went from there, but the explanation of what I want to do is a bit over my head. So, I'm looking for pointers, code, favoured modules, and/or more suggested reading

Re: how-to: custom exception handling?

2003-11-05 Thread drieux
On Wednesday, Nov 5, 2003, at 11:55 US/Pacific, Shaun Fryer wrote: [..] What I hoped to have happen is that if a particular sub returns empty, undef, or void, I will have it trigger the following sub. What I'm unsure of, is how to get the die_msg/STDERR to pass to Die_Mail(). [..]