The code in the BEGIN block runs before Perl has even seen your declaration of the subroutine sub first { .... To work around that, you need to move the BEGIN block below the subroutine declaration(s).
In reply to Re^2: Getopt - Validate arguments before processing -- BEGIN
by Corion
in thread Getopt - Validate arguments before processing
by g_speran
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |