Warnings are one of the most basic ways in which you can get Perl to check the quality of the code that you have produced. Mandatory warnings highlight problems in the lexical analysis stage. Optional warnings highlight cases of possible anomaly.
The traditional way of enabling warnings was to use the -w argument on the
perl -w myscript.pl
You can also supply the option within the "shebang" line:
You can also mention use warnings with all, deprecated and unsafe options.
Eg: use warnings 'all';