Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

eval, DESTROY, die and $@ - educational couple of hours

by lestrrat (Deacon)
on Mar 28, 2002 at 02:33 UTC ( #154876=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      ## names of modules/subs changed for convenience...
      package MySOAP;
    ...
            die $err; ## reraise so SOAP->fault returns true
         }
       }
    
  2. or download this
       ## I really didn't want to subclass DBI, so I just
       ## encapsulate a database handle and proxy all
    ...
       }
    
       1;
    
  3. or download this
     1:  package Foo;
     2:  sub DESTROY
    ...
    13:  if( $@ ) {
    14:     die $@;
    15:  }
    
  4. or download this
       ## with local $@
       me@myhost> perl ~/test.pl; echo $?
    ...
       ## without local $@
       me@myhost> perl ~/test.pl; echo $?
       0
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2021-04-11 11:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?