We'd quite like to see what you've done so far ...
That being said, as above, '.csv' is the usual portable way to handle this.
However, if you really want to go direct to the correct Excel format, try search.cpan.org to find a '.pm' (Perl module).
It's probably there ... somewhere, but it may be a bit fiddly.
Personally I'd use '.csv'