File Coverage

blib/lib/Linux/Pid.pm
Criterion Covered Total %
statement 16 18 88.8
branch 1 2 50.0
condition 2 3 66.6
subroutine 4 4 100.0
pod n/a
total 23 27 85.1


line stmt bran cond sub pod time code
1             package Linux::Pid;
2              
3 2     2   1500 use strict;
  2         4  
  2         74  
4 2     2   11 use warnings;
  2         4  
  2         196  
5              
6             our $VERSION = 0.04;
7             require XSLoader;
8             XSLoader::load('Linux::Pid', $VERSION);
9              
10             sub import {
11 2     2   11 shift;
12 2         7 my $p = caller;
13 2         1635 for my $symbol (@_) {
14 2 50 66     14 if ($symbol eq 'getpid' or $symbol eq 'getppid') {
15 2     2   10 no strict 'refs';
  2         13  
  2         209  
16 2         4 *{$p."::".$symbol} = \&{$symbol};
  2         1925  
  2         5  
17             } else {
18 0           require Carp;
19 0           Carp::croak("Unrecognized symbol $symbol");
20             }
21             }
22             }
23              
24             1;
25              
26             __END__