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   158046 use strict;
  1         2  
  1         23  
4 1     1   5 use warnings;
  1         1  
  1         19  
5 1     1   24 use 5.008001;
  1         3  
6 1     1   4 use base qw( Exporter );
  1         2  
  1         119  
7              
8             BEGIN {
9              
10             # ABSTRACT: Implementation of getppid() for windows
11 1     1   3 our $VERSION = '0.05'; # VERSION
12              
13 1 50       254 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;
23              
24             if($^O eq 'MSWin32')
25             {
26             @EXPORT = qw( getppid );
27             @EXPORT_OK = qw( getppid );
28             }
29             elsif($^O =~ /^(cygwin|msys)$/)
30             {
31             @EXPORT_OK = qw( getppid );
32             }
33             else
34             {
35             @EXPORT_OK = qw( getppid );
36             if($] >= 5.016)
37             {
38             *getppid = \&CORE::getppid;
39             }
40             else
41             {
42             *getppid = sub {
43             package
44             Win32::Getppid::sandbox;
45             getppid();
46             };
47             }
48             }
49              
50              
51             1;
52              
53             __END__