line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Amazon::MechanicalTurk::OSUtil; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '1.00'; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub homeDirectory { |
6
|
17
|
|
|
17
|
0
|
36
|
my $homeDir; |
7
|
17
|
|
|
|
|
38
|
eval { |
8
|
|
|
|
|
|
|
# Looks up home directory for effective user id |
9
|
17
|
|
|
|
|
18151
|
$homeDir = [getpwuid($>)]->[7]; |
10
|
|
|
|
|
|
|
}; |
11
|
17
|
50
|
|
|
|
122
|
if ($@) { |
12
|
|
|
|
|
|
|
# getpwuid doesn't seem to work on ActivePerl |
13
|
|
|
|
|
|
|
# Try using the Windows API to get the home directory. |
14
|
0
|
|
|
|
|
0
|
eval { |
15
|
0
|
|
|
|
|
0
|
require Win32; |
16
|
0
|
|
|
|
|
0
|
$homeDir = Win32::GetFolderPath(Win32::CSIDL_PROFILE()); |
17
|
|
|
|
|
|
|
}; |
18
|
|
|
|
|
|
|
} |
19
|
17
|
|
|
|
|
83
|
return $homeDir; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
return 1; |