Arnaud Blancher wrote:
Stas Bekman a écrit :

ydnar wrote:

The eval() is unecessary. The named sub can be used:

&$func();


yes but not with
 use strict
...

try:


  {
    no strict 'refs';
    &$func();
  }

FWIW, I find $func->() to be a more readable syntax.


You don't need to load anything. Indeed under mp2:

*CORE::GLOBAL::exit = \&ModPerl::Util::exit;

And you don't need to load anything for this to work.

in mp2 exit is implemented via a special die() call, therefore if you call it inside eval { } block (and eval "STRING" behaves identically) an exception is being thrown, but caught by eval.



for me, both solution don't work :-(( maybe me installation is wrong ... the output is always the sum of &first &second

You mean one solution. Indeed, I tried it and it doesn't, since $@ is set to '', which is the same as if eval {} didn't die.


You didn't try the second solution: CORE::exit(0), but you probably don't want to use it as it's not efficient. But it'll work exactly as mod_cgi does.

I consider the inability to exit when called from eval as a problem, so we need to think of finding a better way to emulate exit-but-don't-exit functionality.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Reply via email to