in reply to goto in CORE::GLOBAL::exit - is it safe?

maybe I am not answering the question either and I apologize in advance...

Is seems somehow that it would be better to have a function my_exit() that would be able via switch to call normal exit() o fast_cgi_exit() supposing you'd like to test your code in non-CGI env. But then you need to filter all the code to do that. I don't know if it is an option.

looking at your solution with exit, why this goto EXPR, can't you just do ' *CORE::GLOBAL::exit = sub { fast_cgi_exit() }'

cheers --stephan

  • Comment on Re: goto in CORE::GLOBAL::exit - is it safe?

Replies are listed 'Best First'.
Re^2: goto in CORE::GLOBAL::exit - is it safe?
by powerman (Friar) on Aug 30, 2007 at 15:52 UTC
    What is fast_cgi_exit()? AFAIK there no such 'magical' function, so it's probably something I should write myself. Ok. How it should work? Remember, it may be executed inside several eval's, and I need to jump out from these evals into my FastCGI->Accept() (or CGI::Fast->new()) loop.

    Maybe I misunderstand you... can you please describe your idea about this funciton in more details, provide it pseudocode or point me to existing realization in some perl module?