line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Finance::QuoteHist; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# Simple aggregator for Finance::QuoteHist::Generic instances, |
4
|
|
|
|
|
|
|
# the primary function of which is to specify the order in which |
5
|
|
|
|
|
|
|
# to try the modules upon failure. |
6
|
|
|
|
|
|
|
|
7
|
5
|
|
|
5
|
|
621606
|
use strict; |
|
5
|
|
|
|
|
25
|
|
|
5
|
|
|
|
|
172
|
|
8
|
5
|
|
|
5
|
|
27
|
use vars qw($VERSION $AUTOLOAD); |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
240
|
|
9
|
5
|
|
|
5
|
|
29
|
use Carp; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
268
|
|
10
|
|
|
|
|
|
|
|
11
|
5
|
|
|
5
|
|
3134
|
use Finance::QuoteHist::Generic; |
|
5
|
|
|
|
|
19
|
|
|
5
|
|
|
|
|
1177
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
$VERSION = '1.32'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my @DEFAULT_ENGINES = qw( |
16
|
|
|
|
|
|
|
Finance::QuoteHist::Yahoo |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub new { |
20
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
21
|
0
|
|
|
|
|
|
my %parms = @_; |
22
|
0
|
0
|
|
|
|
|
if (!$parms{lineup}) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
$parms{lineup} = [@DEFAULT_ENGINES]; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
elsif (! ref $parms{lineup}) { |
26
|
0
|
|
|
|
|
|
$parms{lineup} = [$parms{lineup}]; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
elsif (ref $parms{lineup} ne 'ARRAY') { |
29
|
0
|
|
|
|
|
|
croak "Lineup must be passed as an array ref or single-entry string\n"; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# Instantiate the first, pass the rest as champions to the first |
33
|
0
|
|
|
|
|
|
my $first = shift @{$parms{lineup}}; |
|
0
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
eval "require $first"; |
36
|
0
|
0
|
|
|
|
|
croak $@ if $@; |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
my $self = $first->new(%parms); |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
$self; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
0
|
0
|
|
sub default_lineup { @DEFAULT_ENGINES } |
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
0
|
0
|
|
sub granularities { Finance::QuoteHist::Generic->granularities } |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
__END__ |