use WarnUsedOnce; my $var1 = 1; my $var2 = 1; my @array; $var2 = 1; # $var2 used twice # Turn the warnings off for the following code no WarnUsedOnce; my $var3 = 2; __END__ Warnings: Name "main::array" used only once: possible typo at test.pl line 5. Name "main::var1" used only once: possible typo at test.pl line 3.