robertw has asked for the wisdom of the Perl Monks concerning the following question:
why do I get only one quote in @quotes? Thank you very much in advancesub stockquotegetter { my @quotes; $html = get("http://www.iex.nl/Koersen/Aandelen.aspx") or die "Couldn't fetch the stock quotes"; foreach $aandeel (@_) { @url = split(/Realtime koers $aandeel/, $html); @url1 = split(/LastPrice"><span>/, $url[1]); @url2 = split(/</, $url1[1]); #$html =~ m{basevalues['11754LastPrice'] = ([\d,]+) ;}; #printf $_; #printf $sales_rank #$html =~ m{ '11754LastPrice'] = (.*?);}i; # extract destination + of link #$url = $1; printf "$aandeel $url2[0]\n"; push (@quotes,$url2[0]); } printf @quotes } printf &stockquotegetter(qw(Aegon Aperam ING ASML DSM Boskalis KPN Ran +dstad PostNL TomTom));
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: list pushing
by 2teez (Vicar) on Aug 24, 2012 at 13:45 UTC | |
by robertw (Sexton) on Aug 24, 2012 at 16:23 UTC | |
|
Re: list pushing
by toolic (Bishop) on Aug 24, 2012 at 13:33 UTC |