line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::Angle2Zodiac; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
56726
|
use strict; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
42
|
|
4
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
36
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
2953
|
use Getopt::Std; |
|
2
|
|
|
|
|
76
|
|
|
2
|
|
|
|
|
95
|
|
7
|
2
|
|
|
2
|
|
616
|
use Unicode::UTF8 qw(encode_utf8); |
|
2
|
|
|
|
|
766
|
|
|
2
|
|
|
|
|
79
|
|
8
|
2
|
|
|
2
|
|
684
|
use Zodiac::Angle; |
|
2
|
|
|
|
|
47580
|
|
|
2
|
|
|
|
|
468
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = 0.01; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# Constructor. |
13
|
|
|
|
|
|
|
sub new { |
14
|
0
|
|
|
0
|
1
|
|
my ($class, @params) = @_; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# Create object. |
17
|
0
|
|
|
|
|
|
my $self = bless {}, $class; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# Object. |
20
|
0
|
|
|
|
|
|
return $self; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# Run. |
24
|
|
|
|
|
|
|
sub run { |
25
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# Process arguments. |
28
|
0
|
|
|
|
|
|
$self->{'_opts'} = { |
29
|
|
|
|
|
|
|
'a' => 0, |
30
|
|
|
|
|
|
|
'h' => 0, |
31
|
|
|
|
|
|
|
}; |
32
|
0
|
0
|
0
|
|
|
|
if (! getopts('ah', $self->{'_opts'}) || @ARGV < 1 |
|
|
|
0
|
|
|
|
|
33
|
|
|
|
|
|
|
|| $self->{'_opts'}->{'h'}) { |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
print STDERR "Usage: $0 [-a] [-h] [--version] angle\n"; |
36
|
0
|
|
|
|
|
|
print STDERR "\t-a\tOutput will be in ascii form ". |
37
|
|
|
|
|
|
|
"(e.g. 2 sc 31'28.9560'').\n"; |
38
|
0
|
|
|
|
|
|
print STDERR "\t-h\t\tHelp.\n"; |
39
|
0
|
|
|
|
|
|
print STDERR "\t--version\tPrint version.\n"; |
40
|
0
|
|
|
|
|
|
print STDERR "\tangle\tAngle in numeric (e.g. 212.5247100).\n"; |
41
|
0
|
|
|
|
|
|
return 1; |
42
|
|
|
|
|
|
|
} |
43
|
0
|
|
|
|
|
|
$self->{'_angle'} = shift @ARGV; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
print encode_utf8(Zodiac::Angle->new->angle2zodiac($self->{'_angle'}, { |
46
|
|
|
|
|
|
|
'second' => 1, |
47
|
0
|
0
|
|
|
|
|
$self->{'_opts'}->{'a'} ? ( |
48
|
|
|
|
|
|
|
'sign_type' => 'ascii', |
49
|
|
|
|
|
|
|
) : (), |
50
|
|
|
|
|
|
|
}))."\n"; |
51
|
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
|
return 0; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__END__ |