line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::PYX::Optimization; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
96013
|
use strict; |
|
4
|
|
|
|
|
25
|
|
|
4
|
|
|
|
|
115
|
|
4
|
4
|
|
|
4
|
|
28
|
use warnings; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
98
|
|
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
8317
|
use Getopt::Std; |
|
4
|
|
|
|
|
204
|
|
|
4
|
|
|
|
|
305
|
|
7
|
|
|
|
|
|
|
use PYX::Optimization |
8
|
|
|
|
|
|
|
|
9
|
4
|
|
|
4
|
|
1853
|
our $VERSION = 0.03; |
|
4
|
|
|
|
|
137308
|
|
|
4
|
|
|
|
|
1071
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# Constructor. |
12
|
|
|
|
|
|
|
sub new { |
13
|
6
|
|
|
6
|
1
|
8867
|
my ($class, @params) = @_; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# Create object. |
16
|
6
|
|
|
|
|
17
|
my $self = bless {}, $class; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# Object. |
19
|
6
|
|
|
|
|
32
|
return $self; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# Run script. |
23
|
|
|
|
|
|
|
sub run { |
24
|
5
|
|
|
5
|
1
|
10
|
my $self = shift; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# Process arguments. |
27
|
5
|
|
|
|
|
19
|
$self->{'_opts'} = { |
28
|
|
|
|
|
|
|
'h' => 0, |
29
|
|
|
|
|
|
|
}; |
30
|
5
|
100
|
100
|
|
|
18
|
if (! getopts('h', $self->{'_opts'}) || $self->{'_opts'}->{'h'} |
|
|
|
100
|
|
|
|
|
31
|
|
|
|
|
|
|
|| @ARGV < 1) { |
32
|
|
|
|
|
|
|
|
33
|
3
|
|
|
|
|
378
|
print STDERR "Usage: $0 [-h] [--version] [filename] [-]\n"; |
34
|
3
|
|
|
|
|
44
|
print STDERR "\t-h\t\tPrint help.\n"; |
35
|
3
|
|
|
|
|
31
|
print STDERR "\t--version\tPrint version.\n"; |
36
|
3
|
|
|
|
|
31
|
print STDERR "\tfilename\tProcess on filename.\n"; |
37
|
3
|
|
|
|
|
32
|
print STDERR "\t-\t\tProcess on stdin.\n"; |
38
|
3
|
|
|
|
|
16
|
return 1; |
39
|
|
|
|
|
|
|
} |
40
|
2
|
|
|
|
|
57
|
$self->{'_filename_or_stdin'} = $ARGV[0]; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
# PYX::Optimization object. |
43
|
2
|
|
|
|
|
16
|
my $optimizer = PYX::Optimization->new; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
# Parse from stdin. |
46
|
2
|
100
|
|
|
|
219
|
if ($self->{'_filename_or_stdin'} eq '-') { |
47
|
1
|
|
|
|
|
6
|
$optimizer->parse_handler(\*STDIN); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# Parse file. |
50
|
|
|
|
|
|
|
} else { |
51
|
1
|
|
|
|
|
7
|
$optimizer->parse_file($self->{'_filename_or_stdin'}); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
2
|
|
|
|
|
2000
|
return 1; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
__END__ |