## please assume that extracting the page content and ## writing to the excel is already done before this ## following code : $workbook->close; open(FILE, "<$filename") || die "Unable to download file \n"; my @fileholder; @fileholder = ; close (FILE); unlink $filename; print "Content-Type:application/x-download\n"; print "Content Disposition:attachment;filename=report.xls\n\n"; print @fileholder;