Your question about exporting variables from the BEGIN block does not make sense. BEGIN blocks are simply subroutines that are called at compile time. Other than that, they behave just like any other subroutine.
Variables are exported from packages, not from subroutines.