in reply to exit() calls END{} blocks, but these blocks can exit()

When writing a library or module, it is indeed best to avoid exit, unless for when it actually makes sense. (The Mail::Audit module f.ex exits when you call a function that actually takes action with a mail.)

Makeshifts last the longest.

  • Comment on Re: exit() calls END{} blocks, but these blocks can exit()

Replies are listed 'Best First'.
Re: Re: exit() calls END{} blocks, but these blocks can exit()
by meonkeys (Chaplain) on Jul 08, 2002 at 18:52 UTC
    When writing a library or module, it is indeed best to avoid exit, unless for when it actually makes sense.
    Yes, I read this in the docs. But what about my other question? Why is the exit() in END() getting called?

    Update: (Wed Jul 10 22:09:21 PDT 2002)
    Silly me, the exit() in the END{} block is definitely not aborting the program, but is still setting $?, which is what I'd expect. This is clear after reading this.

    ---
    "A Jedi uses the Force for knowledge and defense, never for attack."

      Why is the exit() in END() getting called?

      Because it's there.

      - Yes, I reinvent wheels.
      - Spam: Visit eurotraQ.