how to add switches to a perl program like plackup or dzil
SYNOPSIS
perl -d:Confess $( which dzil ) release
If you are using development tools like https://metacpan.org/pod/Devel::Confess or https://metacpan.org/pod/Devel::cst, and are trying to figure out how to use them with applications with a shebang like dzil, plackup, etc, the 'which' command is your friend. Invoking those scripts with perl should be effectively the same thing, and you can pass whatever switches you want to pass to perl.
See the comments for other ways to achieve the same thing.
The other trick is simply:
Though that has the obvious downside that any child process spawned will inherit those switches.
That, and I'm forever forgetting if its
PERL5OPT
orPERL5OPTS
Much simpler: use -S flag of perl (see perlrun):
See also my dzil profiling tricks from my talk at YAPC::EU.
I need to do this frequently because some people insist on using /usr/bin/env in the shebang line to find the first perl installed instead of using the one the installed it.