I don't understand why you would go through all the trouble first breaking the information apart (data vs. formatting) and then trying to format the data exactly like the way it was. Why are you even trying to read the data? If all you want is 'exporting to html' from perl, you might be better off (on a Win32 platform) controlling perl from excel, using the Win32::OLE module; it allows you to run excel commands on spreadsheets (like editing spreadsheets, saving, creating new worksheets) from perl. The ActiveState documentation that comes with perl has some excellent examples.
If you want to do interpretation of the data, formatting of the table can be simplified using CSS.</p?