use Modern::Perl; use LWP::Simple; use HTML::TableExtract; my $money = get("http://finance.yahoo.com/q/ks?s=MNDO+Key+Statistics") +; my $p = new HTML::TableExtract(); $p->parse($money); my $table = $p->table(2,9); my ($fdr, $fdy, $tdr, $tdy, $fyay, $pr, $dd, $edd, $lsf, $lsd) = map{$ +table->cell($_,1)} (1 .. 10); say $fdr;
Note that you also had an "off by one" error in your loop. The "Forward Annual Dividend Rate" is cell 1, 1 and not 0, 1.
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
In reply to Re: Another Dumb Noob Question - Arrays & Scalar Variables
by CountZero
in thread Another Dumb Noob Question - Arrays & Scalar Variables
by jdlev
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |