Subject: | Price missing on some Yahoo quotes |
Date: | Thu, 10 May 2012 16:26:22 +0200 |
To: | bug-Finance-Quote [...] rt.cpan.org |
From: | Gabriele <gabriele.mailing [...] rvmgroup.it> |
I tried to get quotes for a fund symbol like 2212358.SW on
http://finance.yahoo.com.
I noticed that there is no "price" value, but only "last".
I think it's better to transparently store "last" in "price" if the
latter is empty.
See the sample code below
cat ./tt.pl
#!/usr/bin/perl
use Finance::Quote;
my $q = Finance::Quote->new();
my $source = "yahoo";
my $symbol = "2212358.SW";
my %data = $q->fetch($source, $symbol);
print "Last of $symbol (retrivied from $source) is: '" . $data{$symbol,
'last'} . "'\n";
print "Price of $symbol (retrivied from $source) is: '" . $data{$symbol,
'price'} . "'\n";
--
Gabriele