#!f:\perl\bin\perl #note that strict is commented out, [jjhorner] i'm sure #you'll love that ;) #use strict; use LWP::Simple; my ($webpage,$TickerSymbol,$value,$junk,@wpArray,$counter,$results,%results); my @fields = ("TickerSymbol","LastTraded","NetChange","Open","Low","High","Volume","LastBidSize","LastBidPrice","LastAskSize","LastAskPrice","#ofSharesOutstanding","Rolling52WeekHigh","Rolling52WeekLow","QuotedMarketValue","DividendTimingIndicator","Earnings/Share(trailing12months)","DividendYield"); # ts file is a one-per line list of the TSE ticker symbols # that the user wants in their output # the file is terminated on each line with a comma # to keep the ticker symbol clean open tsFILE, ") { ($TickerSymbol,$junk) = split/,/; $webpage= get "http://www.tse.com/cgi-bin/clan_quote?securityType=TSE-EQUITY&qoteQuery=" . $TickerSymbol; $webpage =~ s/ //g; $webpage =~ s/<[^>]*?>//g; $webpage =~ s/ //g; @wpArray = split (/\n/,$webpage); $counter = 0; foreach $value (@wpArray) { $results{$value} = $wpArray[++$counter]; } $results{"TickerSymbol"} = $TickerSymbol; foreach my $key (@fields) { print "$results{$key}\t"; } print "\n"; }