in reply to Re^2: Upgrading Perl codebase of older Perl version
in thread Upgrading Perl codebase of older Perl version

That works too. I prefer more like
#! /bin/sh exec perl -I /some/path/Net-Clacks/lib -I /another/path/My-Secret-Modu +le/lib myapp.pl "$@"
in a file named debug_myapp.pl, which helps keep my temporary local debugging stuff out of the committed code of the project.

Replies are listed 'Best First'.
Re^4: Upgrading Perl codebase of older Perl version
by cavac (Prior) on Sep 09, 2024 at 13:44 UTC

    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; ...

    PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP
    Also check out my sisters artwork and my weekly webcomics