in reply to problem getting splits with Finance::QuoteHist-1.12

I get the same error. I looked at the source for Finance::QuoteHist, and it appears to use multiple engines, but when I ran it, it only used Finance::QuoteHist::Yahoo. That might be the source of the problem. According to the docs: "Splits are only available embedded in the HTML version of dividends". It could be that to get splits and dividends, you'll need to use the extractors method, but I didn't see any documentation for it.

Here's what I managed to get, sans splits and dividends:

#!/usr/bin/perl use strict; no warnings; use Data::Dumper::Perltidy; use Finance::QuoteHist; my $q = Finance::QuoteHist->new ( symbols => [qw(IBM)], start_date => '05/20/2010', end_date => 'today', ); foreach my $row ($q->quotes()) { my($symbol, $date, $open, $high, $low, $close, $volume) = @$row; } print Dumper($q);

Replies are listed 'Best First'.
Re^2: problem getting splits with Finance::QuoteHist-1.12
by Anonymous Monk on Jun 10, 2010 at 04:13 UTC
    I changed two lines in the module Yahoo.pm and now it works fine.

    These two lines:

    #foreach (grep(/\w+/, split(/\s*,\s+/, $split_line))) {
      #my($date, $post, $pre) = /^(\S+)\D*(\d+):(\d+)/m;
    
    to these ones
    foreach (grep(/\w+/, (split /(=?+\],*)/, $split_line))) {
     my($date, $post, $pre) = /^(.+)\[(\d+):(\d+)/m;
    
    Hope is works for you. IsaacN