File Coverage

blib/lib/Win32/Getppid.pm
Criterion Covered Total %
statement 13 15 86.6
branch 1 2 50.0
condition n/a
subroutine 5 5 100.0
pod n/a
total 19 22 86.3


line stmt bran cond sub pod time code
1             package Win32::Getppid;
2              
3 1     1   187860 use strict;
  1         7  
  1         22  
4 1     1   4 use warnings;
  1         2  
  1         17  
5 1     1   16 use 5.008001;
  1         3  
6 1     1   3 use base qw( Exporter );
  1         2  
  1         158  
7              
8             BEGIN {
9              
10             # ABSTRACT: Implementation of getppid() for windows
11 1     1   4 our $VERSION = '0.06'; # VERSION
12              
13 1 50       176 if($^O =~ /^(cygwin|MSWin32|msys)$/)
14             {
15 0           require XSLoader;
16 0           XSLoader::load('Win32::Getppid', $Win32::Getppid::VERSION);
17             }
18              
19             }
20              
21             our @EXPORT;
22             our @EXPORT_OK = qw( getppid );
23              
24             if($^O eq 'MSWin32')
25             {
26             @EXPORT = qw( getppid );
27             }
28             elsif($^O =~ /^(cygwin|msys)$/)
29             {
30             # Allow import, but not by default
31             # on cygwin/msys
32             }
33             else
34             {
35             if($] >= 5.016)
36             {
37             *getppid = \&CORE::getppid;
38             }
39             else
40             {
41             *getppid = sub {
42             package
43             Win32::Getppid::sandbox;
44             getppid();
45             };
46             }
47             }
48              
49              
50             1;
51              
52             __END__