MechanicalTurk/OSUtil.pm untested

filter: Statementstmt 0.0% 0 / 13 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 18 CC 2 SCAR 15.4
CC
2
Cov
0%
homeDirectory
6.0
BEGIN
2.0
CRAP 4.7
1 package Net::Amazon::MechanicalTurk::OSUtil;
2  
3 our $VERSION = '1.00';
4  
5 sub homeDirectory {
6 my $homeDir;
7 eval {
8 # Looks up home directory for effective user id
9 $homeDir = [getpwuid($>)]->[7];
10 };
11 if ($@) {
12 # getpwuid doesn't seem to work on ActivePerl
13 # Try using the Windows API to get the home directory.
14 eval {
15 require Win32;
16 $homeDir = Win32::GetFolderPath(Win32::CSIDL_PROFILE());
17 };
18 }
19 return $homeDir;
20 }
21  
22 return 1;