#!/usr/bin/perl -w
#
# Declare (and call) a sub within a sub.
use strict;
use warnings;
{
print "In the mainline.\n";
sub level1 {
print "Inside level1!\n";
}
level1();
print "Finished!\n";
}
####
foo@bar:~/dev$ perlcritic --severity=4 subinsub.pl
Subroutine does not end with "return" at line 11, column 5. See page 197 of PBP. (Severity: 4)
####
foo@bar:~/dev$ perl -w subinsub.pl
In the mainline.
Inside level1!
Finished!