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
|
|
625245
|
use strict; |
|
5
|
|
|
|
|
26
|
|
|
5
|
|
|
|
|
184
|
|
8
|
5
|
|
|
5
|
|
28
|
use vars qw($VERSION $AUTOLOAD); |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
274
|
|
9
|
5
|
|
|
5
|
|
28
|
use Carp; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
287
|
|
10
|
|
|
|
|
|
|
|
11
|
5
|
|
|
5
|
|
3127
|
use Finance::QuoteHist::Generic; |
|
5
|
|
|
|
|
20
|
|
|
5
|
|
|
|
|
1148
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
$VERSION = '1.30'; |
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__ |