厳密な構文チェック
コマンドでチェック
perl -cw プログラムファイル
C:\Perl\src>perl -cw strict.pl Name "main::num" used only once: possible typo at strict.pl line 3. Name "main::nun" used only once: possible typo at strict.pl line 4. strict.pl syntax OK
ソースでチェック
use warnings
C:\Perl\src>perl strict.pl Name "main::num" used only once: possible typo at strict.pl line 3. Name "main::nun" used only once: possible typo at strict.pl line 4. Use of uninitialized value in print at strict.pl line 4.
use strict
C:\Perl\src>perl strict.pl Global symbol "$num" requires explicit package name at strict.pl line 3. Global symbol "$nun" requires explicit package name at strict.pl line 4. Execution of strict.pl aborted due to compilation errors.
結果みて、なんとなくイメージがついた。