File: main_subs_and_pod.pl

package info (click to toggle)
libperl-metrics-simple-perl 1.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 344 kB
  • sloc: perl: 1,433; makefile: 7
file content (41 lines) | stat: -rw-r--r-- 611 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package main_subs_and_pod; # 1

use strict; # 2
use warnings; # 3

our $VERSION = '1.0'; # 4

our $EXPECTED_NON_SUB_LINES = 8; #5

exit run(@ARGV) if not caller(); # 6

sub run {
    my @args = @_;
    say( @args );
    return 1;
}

sub say {
    my @args = @_;
    print "@args";
}

1;   # 7 This line is in "main" and so counts as a non-subroutine line.

# the __END__ token also counts as a line of code.s
__END__

bad_line of code

=pod

=head1 NAME

Fake::Package::For::Testing

=head1 DESCRIPTION

Used to test counts of lines not in any subroutine. That count should NOT
includes comments and pod.

=cut