http://www.perlmonks.org?node_id=918274

danielv has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I have a code with some parts that can't be changed. From one such a part called function which should return "Access denied" in case the test failed.

Return performed by exit(1);

This works fine ... till the modperl version was changed and instead of "Access denied" message I get:

"Software error: ModPerl::Util::exit: (120000) exit was called at ..."

I know that the correct way is to switch the exit to return but since I can't touch the caller this flow is impossible :(

As I can see the exit() function was changed from Apache::exit() to ModPerl::Util::exit() .

Does this change the source of my problem or I need to search deeper?

Is there any way to perform exit with saving original behavior?

Thanks a lot.

Replies are listed 'Best First'.
Re: Issue with ModPerl::Util::exit()
by moritz (Cardinal) on Aug 03, 2011 at 14:31 UTC
    I know that the correct way is to switch the exit to return but since I can't touch the caller this flow is impossible :(

    This is a bit like "I know how to make a phone call using a phone, but I'm not allowed to, so how can I make a phone call be only using a coffee mug?"

    Does this change the source of my problem

    No, the source of your problem still is that you're not allowed to touch outdated/broken software. Find a way to lift that restriction.

      This is a bit like "I know how to make a phone call using a phone, but I'm not allowed to, so how can I make a phone call be only using a coffee mug?"

      Quite a good example...

      No, the source of your problem still is that you're not allowed to touch outdated/broken software. Find a way to lift that restriction.

      This is very old code and I work for some company. No one doesn't take on himself to permit such a change... I am already got a negative answer when I try to do the change and asked to fix a problem without changing the core ...

      I need to find some backdoor way to solve that... I need a help ...