Whitey has asked for the wisdom of the Perl Monks concerning the following question:

I have the following piece of code that I would like to strip into a flat file and assign variables to the numbers. Can I use perl to strip the date and the values from this code? How do I assign each of the numbers a unique variable?
<table border="1" cellspacing="1" width="449" bordercolor="#000000" he +ight="60"> <tr> <td width="33%" height="16"><b>Country</b></td> <td width="17%" height="16"><b>This Week</b></td> <td width="17%" height="16"><b>Last Week</b></td> <td width="17%" height="16"><b>Last Month</b></td> <td width="17%" height="16"><b>Last Year</b></td> </tr> <tr> <td height="16"><p align="center"><b>United States</b></td> <td height="16"> <p align="center">1266</td> <td height="16"> <p align="center">1278</td> <td height="16"> <p align="center">1275</td> <td height="16"> <p align="center">975</td> </tr> <tr> <td height="10"><p align="center"><b>Canada</b></td> <td height="10"> <p align="center">287</td> <td height="10"> <p align="center">343</td> <td height="10"> <p align="center">322</td> <td height="10"> <p align="center">319</td> </tr> </table>
Thank you

Replies are listed 'Best First'.
Re: Grabbing data from an HTML file
by Chmrr (Vicar) on Jul 31, 2001 at 09:42 UTC

    Take a gander at HTML::TableExtract -- I think it will suit your needs admirably.

     
    perl -e 'print "I love $^X$\"$]!$/"#$&V"+@( NO CARRIER'

Re: Grabbing data from an HTML file
by Whitey (Novice) on Jul 31, 2001 at 09:41 UTC
    I mean putting the data into an array. How do I strip the data and put it into an array?