CGI::Simple code is used to get the script name:
sub script_name { $ENV{'SCRIPT_NAME'} || $0 || '' }
Based on this, I see several options:
- set
$ENV{SCRIPT_NAME} and $0 to false - subclass or monkey-patch CGI :: Simple redefinition of
script_name
Messing with global makes me nervous. Changing $0 is harmless. Maybe.
Paranoia means that I would override script_name to minimize the impact of my changes.
The monkey patch is so simple, it is seductive:
{ no warnings 'redefine'; sub CGI::Simple::script_name {''} }
But the correct subclass is not too complicated, and it minimizes the impact (but you probably have several CGI :: Simple objects in your application?):
package CGI::Simple::NoScriptName; use base 'CGI::Simple'; sub script_name {''}; 1;
source share