#!/usr/bin/perl # use strict; use warnings; BEGIN { @INC = ( "/opt/app/lib" ); use Application::Module; } #### Can't locate Application/Module.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at ./test2.pl line 8. BEGIN failed--compilation aborted at ./test2.pl line 8. #### #!/usr/bin/perl # use strict; use warnings; BEGIN { @INC = ( "/opt/app/lib" ); eval "use Application::Module"; } #### #!/usr/bin/perl # use strict; use warnings; BEGIN { @INC = ( "/opt/app/lib" ); } use Application::Module; #### #!/usr/bin/perl # use strict; use warnings; BEGIN { local @INC = ( "/opt/app/lib" ); use Application::Module; } #### #!/usr/bin/perl # use strict; use warnings; BEGIN { print "here we are in our begin block\n"; eval { print "here we are in our eval block\n"; INIT { print "here we are in an init block in an eval\n"; } BEGIN { print "here we are in a BEGIN block in an eval in a BEGIN block\n"; } }; BEGIN { print "here we are in our nested begin block\n"; } } CHECK { print "here we are in our check block\n"; } INIT { print "here we are in our init block\n"; } #### here we are in a BEGIN block in an eval in a BEGIN block here we are in our nested begin block here we are in our begin block here we are in our eval block here we are in our check block here we are in an init block in an eval here we are in our init block #### #!/usr/bin/perl # use strict; use warnings; BEGIN { print "here we are in our begin block\n"; eval ' print "here we are in our eval block\n"; INIT { print "here we are in an init block in an eval\n"; } BEGIN { print "here we are in a BEGIN block in an eval in a BEGIN block\n"; } '; BEGIN { print "here we are in our nested begin block\n"; } } CHECK { print "here we are in our check block\n"; } INIT { print "here we are in our init block\n"; } #### here we are in our nested begin block here we are in our begin block here we are in a BEGIN block in an eval in a BEGIN block here we are in our eval block here we are in our check block here we are in an init block in an eval here we are in our init block