in reply to Re: Getopt - Validate arguments before processing -- BEGIN
in thread Getopt - Validate arguments before processing

as long as sub first is defined below the BEGIN block,
even if the only argument is '--first' (i.e. no invalid options),
you'll have
Undefined subroutine &main::first called at .../Getopt/Long.pm line 60 +7. Available options are: --first --help Invalid options passed to ....pl BEGIN failed--compilation aborted at ....pl line 17.
which means, as Corion already mentioned, you have to move the BEGIN block below the subroutines, which defeats the purpose.

besides, from an esthetic viewpoint, it isn't nice, if a program reacts with a "compilation error" to a wrong invocation.

I think I like haukex's variant "push @actions" best, and it would even allow for an optional --ignore-unknown-switches or --please-dont-die switch to suppress dying on invalid options ;-)