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

I am running perl in a DOS window on a PC running Windows ME. The following code displays on the CRT in the font and size called out when script was invoked (perl program.pl -font "Courier 16"):
foreach $play (@ranked) { if (($play->{track} ne '') && ($play->{track} ne 0)){ $title = pack("A32", "$play->{title}"); $artist = pack("A32", "$play->{artist}"); $album = $play->{album}; $track = $play->{track}; if(length($track) == 1){ $track = '0'.$track; } $listbox->insert('end', "$title$artist$play->{album}-$track"); } }
When I need to put the same information to a file, I use:
open(REPORT, ">report.dat") || die("Can't open output file"); @ranked = sort by_artist @hash; foreach $play (@ranked) { if($play->{track} != 0) { $title = $play->{title}; $artist = $play->{artist}; $album = $play->{album}; $track = $play->{track}; if(length($track) == 1){ $track = '0'.$track; } write REPORT; } } close(REPORT);
When I examine the file report.dat, it contains text only. How do I generate a file containing text and fonts, size, etc.? or How can I send this to the local printer along with font, size, etc.?

Replies are listed 'Best First'.
Re: How to print fonts to printer
by maa (Pilgrim) on Mar 05, 2004 at 20:23 UTC
Re: How to print fonts to printer
by muba (Priest) on Mar 05, 2004 at 20:56 UTC
    What about HTML output?
    Easy as that, I'd say?
Re: How to print fonts to printer
by arden (Curate) on Mar 06, 2004 at 02:51 UTC
    Then there's also RTF::Document and RTF::Writer. Since you're on a Win32 system, it might be a bit more along the lines what you'd associate with Windows. And then there's Net::Printer to send this to the local printer.

    - - arden.