Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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

by lestrrat (Deacon)
on Mar 28, 2002 at 02:33 UTC ( [id://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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-03-29 06:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found