astaines has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I want to make structured documents, possibly Excel sheets or Word documents, on a Linux machine. I am generating large numbers, (tens of thousands) of random telephone numbers, using Perl on a Linux machine. I have to generate worksheets, in a specific format, with 14 numbers on each page for use by interviewers.

I can (and am) making these worksheets as Excel sheets on a Win32 machine using Perl (Win32::OLE and it's friends). It occurred to me that it might be possible to make these files on my Linux machine. Not greatly to my surprise, Win32::OLE won't install under Linux. (This isn't a criticism of the dedicated and much appreciated coders who work so hard to make these modules.)

So, two questions :-

Is it possible to run the Win32 modules, say under Wine, or some other way?

I don't have to use MS Office - I just have to print these things, and share them with MS office users. Can I do something similar with OO and Perl? If so, how?

--
Anthony Staines

Comment on Making MS Office compatible files on Linux machines with Perl.

I used RTF::Writer (I think) to do this a while
ago. It was, um, not fun; after generating a few documents
that wedged NT4/Office2k machines to the point that a hard
reset was needed, I ended up generating most of the RTF by
hand. It may have changed in the past two years or so since
I had to use it, but I'd be careful.

I'm not happy with the design of RTF::Writer, either. It'll take care of header information for you, but it doesn't properly abstract things that should be abstracted (like making a bold paragraph). I shouldn't have to know that '\fs20' is a 10-point font. I should be able tell RTF::Writer to put a 20-point font and it'll take care of the details. That's why you have a module to abstract these things. As it is, you end up writing a lot of the RTF by hand, anyway.

----send money to your kernel via the boot loader.. This and more wisdom available from Markov Hardburn.

I'm missing something here. You have a working system using Perl on a Win32 machine. You don't mention it, but I guess it's too slow or too awkward or for some other reason, you want to do it on a Linux box, is that right?

Well, noone has mentioned the fun and excitement you could possibly enjoy by emitting XML or HTML tables and having Excel import them...Only works on 97 or later, but it's another way to do it. Googling or CPAN should help.