In my mind, part of the "shifting left" philosophy is making sure the developer sees any warnings or errors as early as possible. This is unfortunately more difficult in CGI scripts. Some Perl modules that make this easier:
CGI::Carp(last updated Feb 2022, first released Jul 2009)
This is the default that most people use, just because it was included in the Perl core modules.
CGI.pm was removed in Perl 5.20.3 because it was felt to be too old and crufty.
The fatalsToBrowser feature works pretty well.
However, the warningsToBrowser() feature isn't so good: 1) You have to explicitly call warningsToBrowser() at the very end of your program, 2) the warnings are shown as HTML comments only! (IMHO, they should be bold, red, and flashing, at least in dev and test environments)
I couldn't quite get it to work for me though. In the situation where the CGI script wanted to print a 302 redirect, CGI::Debug actually displayed its content first, preventing the 302 redirect from happening.