line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package IO::Die; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
256
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub chdir { |
6
|
8
|
|
|
8
|
0
|
3161
|
my ( $NS, @args ) = @_; |
7
|
|
|
|
|
|
|
|
8
|
8
|
|
|
|
|
36
|
local ( $!, $^E ); |
9
|
|
|
|
|
|
|
|
10
|
8
|
|
|
|
|
10
|
my $ret; |
11
|
|
|
|
|
|
|
|
12
|
8
|
100
|
|
|
|
39
|
if (@args) { |
13
|
4
|
100
|
|
|
|
69
|
$ret = CORE::chdir( $args[0] ) or do { |
14
|
1
|
50
|
|
|
|
6
|
if ( __is_a_fh( $args[0] ) ) { |
15
|
0
|
|
|
|
|
0
|
$NS->__THROW('Chdir'); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
else { |
18
|
1
|
|
|
|
|
5
|
$NS->__THROW( 'Chdir', path => $args[0] ); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
}; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
else { |
23
|
4
|
100
|
|
|
|
76
|
$ret = CORE::chdir or do { |
24
|
2
|
|
|
|
|
5
|
my $path = _get_what_chdir_took_as_homedir(); |
25
|
|
|
|
|
|
|
|
26
|
2
|
100
|
|
|
|
5
|
if ( !defined $path ) { |
27
|
1
|
|
|
|
|
4
|
$NS->__THROW('Chdir'); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
1
|
|
|
|
|
4
|
$NS->__THROW( 'Chdir', path => $path ); |
31
|
|
|
|
|
|
|
}; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
5
|
|
|
|
|
31
|
return $ret; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub _get_what_chdir_took_as_homedir { |
38
|
2
|
|
|
2
|
|
4
|
my $path = $ENV{'HOME'}; |
39
|
2
|
100
|
|
|
|
6
|
if ( !defined $path ) { |
40
|
1
|
|
|
|
|
1
|
$path = $ENV{'LOGDIR'}; |
41
|
|
|
|
|
|
|
|
42
|
1
|
50
|
33
|
|
|
10
|
if ( !defined($path) && $^O eq 'VMS' ) { |
43
|
0
|
|
|
|
|
0
|
$path = $ENV{'SYS$LOGIN'}; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
2
|
|
|
|
|
5
|
return $path; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |