in reply to dynamically loading modules/maintaining dev v. prod modules

How you're trying to do this will not work, with or without a BEGIN block. use is evaluated at compile time, and both use libs in that code fragment will need to be compiled, and thus will be executed. Other ways:

use lib (index($ENV{SCRIPT_NAME},'/dev/') == -1) ? "/blah/perllib/" : "/blah/perldev/"; # -- or -- BEGIN { require lib; if ( index( $ENV{SCRIPT_NAME}, '/dev/' ) == -1 ) { lib->import("/blah/perllib/"); } else { lib->import("/blah/perldev/"); } } } # -- or -- BEGIN { if (index( $ENV{SCRIPT_NAME}, '/dev/' ) == -1 ) { unshift @INC, "/blah/perllib/"; } else { unshift @INC, "/blah/perldev/"; } } }