| 1 | #!/usr/bin/env perl | ||||||||||
| 2 | 1 | ▶ | use strict; use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use English; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use File::Basename; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use File::Spec; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | my $dir = dirname(__FILE__); | |||||||||
| 7 | 1 | my $libdir = File::Spec->catfile($dir, '..', 'lib'); | |||||||||
| 8 | # Something to make sure we are recursing subroutines. | ||||||||||
| 9 | sub five() { | ||||||||||
| 10 | 5 | ||||||||||
| 11 | } | ||||||||||
| 12 | 1 | my $file; | |||||||||
| 13 | 1 | ▶ | if (scalar @ARGV) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | 0 | $file = shift @ARGV; | |||||||||
| 15 | 0 | ▶ | die "Can't find file $file" unless -f $file; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | } else { | ||||||||||
| 17 | 1 | $file = __FILE__; | |||||||||
| 18 | } | ||||||||||
| 19 | 1 | ▶ | open FH, '<', $file or die $!; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 20 | 1 | local $INPUT_RECORD_SEPARATOR; # enable localized slurp mode | |||||||||
| 21 | 1 | my $content = <FH>; | |||||||||
| 22 | 1 | ▶ | open STDERR, '>', '/dev/null' or die $!; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | 1 | my $rc = system ($EXECUTABLE_NAME, "-I$libdir", '-MO=CodeLines,-exec', '-e', | |||||||||
| 24 | $content); | ||||||||||
| 25 | 1 | ▶ | unless (0 == $rc) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | 0 | die "$file didn't parse\n"; | |||||||||
| 27 | } | ||||||||||