in reply to Re^3: Avoiding INIT
in thread Avoiding INIT

The idea it to postpone processing the command line until the last moment. The INIT block is just one sub call, prefixed, of course with an underscore to suggest that you (the user) really does not want to go there.

The idea is to eliminate a potential source of confusion. I know that when I was developing tests I was constantly asking myself, "WTF is this?" before remembering that I was looking at the INIT block -- which I had written of course :-(.

Replies are listed 'Best First'.
Re^5: Avoiding INIT
by ikegami (Patriarch) on Feb 09, 2010 at 21:02 UTC

    The idea it to postpone processing the command line until the last moment.

    That doesn't answer my question at all.

    Under the fair assumption that yours is the only module that has a CHECK block, the INIT block will be called immediately after the CHECK block. Thus, if the content of the INIT block were to be moved into the CHECK block, it would be executed at exactly the same time as before.

      Ah! Sorry 'bout that. I can't make that assumption. The module in question is Getopt::Auto. Who knows what context it was invokde in?
        In what context would it make a difference?