I think you're on the right track. You can use the variable $^{TAINT} and exec instead of system :
exec($^X, $0, '-T', @ARGV) if $^{TAINT} < 1;
This will not work in all cases. Firstly, you will lose some other command line switches, from which a script is usually called using:
perl -I/path/to/some/more/libs -w -MNecessary::Module myscript.pl ...
There are some ways to work around some of them ( use warnings or add -w ) to your exec statement above, analyze @INC and %INC to determine which -I and -M keys were added), but the more you learn how your script, the more you can figure out which workarounds you need to worry about.
Depending on the dynamics of the group in the game, another approach here is to exercise some indirect control over the calling program. Go ahead and put -T on the shebang line, as @Hunter McMillen and @ThisSuitIsBlackNot suggest waiting for the error report and then diagnosing the problem as "not called by the program using the -T switch ..."
mob
source share