Subject: | unable to get Finance::Quote to work |
Date: | Thu, 11 Oct 2018 00:54:43 -0700 |
To: | bug-Finance-Quote [...] rt.cpan.org |
From: | Prashant Singh <sheenu.prashant [...] gmail.com> |
Hello,
I am trying to use Finance::Quote module to get stock prices but unable
to get it to work.
*version*: Finance-Quote-1.47
*perl*: strawberry perl (v5.28.0)
OS: Windows 7 Enterprise (64 bit)
Please find the code below and the output.
*CODE*:
*use strict;*
*use warnings;*
*use Finance::Quote;*
*getquote('googl', '20140822');*
*my $s;*
*sub getquote*
*{*
* my ($sym, $qdate) = @_;*
* $sym = uc($sym);*
* my $quote = Finance::Quote->new;*
* my @exchanges = sort($quote->sources);*
* $quote->timeout(60);*
* $quote->require_labels(qw/price date high low volume/);*
* $quote->set_currency('USD');*
* my $exch = 'usa';*
* my %info = $quote->fetch($exch, $sym);*
* if (!%info)*
* {*
* $s = "getquote ERROR: No information returned for symbol $sym from
$exch";*
* warn $s;*
* return;*
* }*
* my $dt = $info{$sym, 'date'};*
* print "Price of $sym is " . $info{$sym, 'price'} . ' for ' . $dt .*
*+ "\n"; # DEBUG*
*}*
*OUTPUT:*
C:\strawberryPerl\scripts>perl getStockPrice2.pl
getquote ERROR: No information returned for symbol GOOGL from usa at
getStockPri
ce2.pl line 24.
C:\strawberryPerl\scripts>
Any help would be appreciated!!
Thanks and Regards
-Prashant