jdlev has asked for the wisdom of the Perl Monks concerning the following question:
The problem arises when I try to assign a numeric value to an array that houses the 10 different variables I'm tryin to give the values to (It's towards the very bottom) Here's my code:
use strict;
use warnings;
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);
#foreach my $row ($table->rows ()) {
# ! defined and $_ = ' ' for @$row;
# print "$row->[0]\n";
# print "$row->1\n";
# print "@$row\n";
#}
#Forward Annual Dividend Rate = $fdr
#Forward Annual Dividend Yield = $fdy
#Trailing Annual Dividend Rate = $tdr
#Trailing Annual Dividend Yield = $tdy
#5 Year Average Dividend Yield = $fyay
#Payout Ratio = $pr
#Dividend Date = $dd
#Ex-Dividend Date = $edd
#Last Split Factor = $lsf
#Last Split Date = $lsd
my @Dividend_Values = (my $fdr, my $fdy, my $tdr, my $tdy, my$fyay, my $pr, my $dd, my $edd, my $lsf, my $lsd);
for (my $count=0; $count < 11; $count++)
{
my $cell = $table->cell($count,1);
#print "$cell \n";
$Dividend_Values$count = $cell;
}
print $fdr;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Another Dumb Noob Question - Arrays & Scalar Variables
by roboticus (Chancellor) on Mar 07, 2011 at 05:06 UTC | |
Re: Another Dumb Noob Question - Arrays & Scalar Variables
by ikegami (Patriarch) on Mar 07, 2011 at 04:14 UTC | |
Re: Another Dumb Noob Question - Arrays & Scalar Variables
by CountZero (Bishop) on Mar 07, 2011 at 07:27 UTC |