Code before strictures are enabled

Sample script generating this:

examples/critic/no_stricture.pl

print "Hello World\n";
use strict;

TestingAndDebugging::RequireUseStrict

Always have use strict at the beginning of your Perl files.

Related articles:

Bareword file handle opened

examples/critic/bareword_file_handle.pl

use 5.010;
use strict;

open FH, '<', 'data.txt';

InputOutput::ProhibitBarewordFileHandles

Two-argument "open” used

examples/critic/two_argument_open.pl

use 5.010;
use strict;

open my $fh, 'data.txt';

InputOutput::ProhibitTwoArgOpen

"return" statement with explicit "undef"

examples/critic/return_undef.pl

use 5.010;
use strict;

sub f {
    return undef;
}

Subroutines::ProhibitExplicitReturnUndef

Nested named subroutine

examples/critic/nested_subs.pl

use 5.010;
use strict;

sub f {
   sub g {
   }
}

Subroutines::ProhibitNestedSubs

Package declaration must match filename

Three-argument form of open used .... Three-argument open is not available until perl 5.6.

Use of "open" is not allowed ..... Use file operation methods of MainObject instead.