Popcorn Dave has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to send output to my laser printer. All well and good except I can't get it to actually eject the page. What happens is that the text is sent, and the light is flashing on the laser printer showing there is a page waiting to be ejected and that's it. If I physically push the button to eject the page, it will give me the page. I've tried setting autoflush but it's not working.
Here's what I was playing with:
use strict; use FileHandle; STDOUT->autoflush(1); #$| = 1; my $text = "Printing test...\n"; open FH, ">LPT1:"; print FH "$text\n";
Neither $++ or use FileHandle seems to be doing the trick. Should I be sending an eject code instead of or in addition to autoflush?
Thanks in advance!
Update: Adding .chr(12) to the string $text kicks the page out like I was after.
Thanks to ikegami for pointing out my output file error.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Autoflushing Laser printer
by ikegami (Patriarch) on Nov 16, 2004 at 01:40 UTC | |
|
Re: Autoflushing Laser printer
by chromatic (Archbishop) on Nov 16, 2004 at 03:34 UTC |