My full BEGIN checks for the "--debug" command line switch to enable the INC modifications, disable some caching/precompression algorithms (for faster startup) and also enable extra debug output:
... use Array::Contains; ... our $isDebugging; BEGIN { if(contains('--debug', \@ARGV)) { print("Development INC activated\n\n"); my $uname = 'cavac'; if(defined($ENV{PC_LINUXUSER}) && $ENV{PC_LINUXUSER} ne '') { $uname = $ENV{PC_LINUXUSER}; } unshift @INC, "/home/$uname/src/Net-Clacks/lib"; unshift @INC, "/home/$uname/src/pagecamel_framework/lib"; unshift @INC, "/home/$uname/src/pagecamel_er_base/lib"; $isDebugging = 1; } else { $isDebugging = 0; } } ... my $backend = PageCamel::CMDLine::WebBackend->new($isDebugging, $confi +gfile); $backend->run; ...
In reply to Re^4: Upgrading Perl codebase of older Perl version
by cavac
in thread Upgrading Perl codebase of older Perl version
by programmingzeal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |