# mycgi.pl use CGI; my $cgi = CGI->new; print $cgi->header( -type => 'application/vnd.ms-excel', #-nph => 1, -expires => '+3d', #-charset => 'utf-8', -charset => '', -attachment => 'foo.xls', ); # you need a foo.xls in your local dir open (IMAGE, '<', 'foo.xls'); print ; close IMAGE;