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 4     4   40077 use strict;
  4         5  
  4         91  
4 4     4   11 use warnings;
  4         5  
  4         75  
5 4     4   60 use 5.008001;
  4         8  
6 4     4   12 use base qw( Exporter );
  4         4  
  4         562  
7              
8             BEGIN {
9              
10             # ABSTRACT: Implementation of getppid() for windows
11 4     4   7 our $VERSION = '0.04'; # VERSION
12              
13 4 50       627 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(eval q{ require 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__