-----Original Message----- >From: Paul Johnson <[EMAIL PROTECTED]> >Sent: Aug 13, 2007 7:45 PM >To: Jeff Pang <[EMAIL PROTECTED]> >Cc: Paul Lalli <[EMAIL PROTECTED]>, beginners@perl.org >Subject: Re: die and exit > >On Mon, Aug 13, 2007 at 07:24:56PM +0800, Jeff Pang wrote: > >> >> sub exit { >> >> print "test exit"; >> >> exit; >> >> } >> > >> >This does not "overwrite" exit. Your own subroutine &exit and the >> >built-in CORE::exit() are not the same thing. >> >> Then how to overwrite CORE::exit? >> Can anybody help explain how Apache::exit overwrite CORE::exit? > >$ perl -le 'BEGIN { *CORE::GLOBAL::exit = sub { print 42 } } exit; print 99' >42 >99 >
Yes that's fine. I think when we say 'use Apache qw/exit/' in modperl scripts,it may do the same things as you mentioned -- modify the typeglob directly -- but I'm not so sure. Thanks. -- Jeff Pang <[EMAIL PROTECTED]> http://home.arcor.de/jeffpang/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/