Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Turn off warnings selectively and in a small scope

  • no warnings
#!/usr/bin/perl 
use strict;
use warnings;

my $total;

add();

print "$total\n";


sub add {
    no warnings 'uninitialized';
    $total = $total + rand();
}
See
perldoc warnings       for the use of warnings
perldoc perllexwarn    for the warning categories
perldoc perldiag       for a list of warnings and errors