in reply to Find out, if "use warnings(all)" and "use strict(all)" are used
Warnings can also be switched on with the -w command line option, and this is what $^W is used for. In this case just test for truth. So for warnings you may need:if (exists($INC{'strict.pm'})) { print "strict\n" } if (exists($INC{'warnings.pm'})) { print "warnings\n" }
if (exists($INC{'warnings.pm'}) || $^W) {print "Warnings\n"};
|
|---|