in reply to How to write to a excel file while downloading in cgi perl

I think you should change the order of operations:

  1. Extracts the page content using LWP::UserAgent, HTML::TableExtract
  2. Creates the Excel using Spreadsheet::WriteExcel
  3. Writes to the excel and closes it
  4. Lets the user download it

This way you would avoid creating the Excel file if the content recovered is not correct (think getting a 404 from LWP).

I would also consider two things:

Alceu Rodrigues de Freitas Junior
---------------------------------
"You have enemies? Good. That means you've stood up for something, sometime in your life." - Sir Winston Churchill
  • Comment on Re: How to write to a excel file while downloading in cgi perl