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
- How to return nothing (or undef) from a function in Perl?
- wantarray - returning list or scalar based on context
Nested named subroutine
examples/critic/nested_subs.pl
use 5.010;
use strict;
sub f {
sub g {
}
}
Subroutines::ProhibitNestedSubs