File Coverage

blib/lib/Palm.pm
Criterion Covered Total %
statement 13 15 86.6
branch n/a
condition n/a
subroutine 4 6 66.6
pod 3 3 100.0
total 20 24 83.3


line stmt bran cond sub pod time code
1             package Palm;
2             #
3             # ABSTRACT: Palm OS utility functions
4             #
5             # Copyright (C) 1999, 2000, Andrew Arensburger.
6             #
7             # This program is free software; you can redistribute it and/or modify
8             # it under the same terms as Perl itself.
9             #
10             # This program is distributed in the hope that it will be useful,
11             # but WITHOUT ANY WARRANTY; without even the implied warranty of
12             # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either the
13             # GNU General Public License or the Artistic License for more details.
14              
15 2     2   16340 use strict;
  2         3  
  2         78  
16 2     2   10 use warnings;
  2         4  
  2         70  
17 2     2   8 use vars qw( $VERSION );
  2         1  
  2         365  
18              
19             # One liner, to allow MakeMaker to work.
20             $VERSION = '1.400';
21             # This file is part of Palm 1.400 (March 14, 2015)
22              
23              
24             my $EPOCH_1904 = 2082844800; # Difference between Palm's
25             # epoch (Jan. 1, 1904) and
26             # Unix's epoch (Jan. 1, 1970),
27             # in seconds.
28              
29              
30             sub palm2epoch {
31 0     0 1 0 return $_[0] - $EPOCH_1904;
32             }
33              
34              
35             sub epoch2palm {
36 0     0 1 0 return $_[0] + $EPOCH_1904;
37             }
38              
39              
40             sub mkpdbname {
41 4     4 1 703 my $name = shift;
42 4         13 $name =~ s![%/\x00-\x19\x7f-\xff]!sprintf("%%%02X",ord($&))!ge;
  3         20  
43 4         9 return $name;
44             }
45              
46              
47             1;
48              
49             __END__