Printing from Perl on NT box 
Author Message
 Printing from Perl on NT box

Quote:

>How do I open a filehandle for printing in Perl on NT?

>I want to be able to do something like
>open(P,"some way to designate a printer");
>print P "this string goes to printer";
>close P;

>Or - I need some way to accomplish the equivalent on NT.

Hi Bob,

Fancy meeting you here ;-) I noticed your post right when I
posted mine--I'll trade answers with ya:

I'm using the porters' version of Win32 Perl, at 5.004, and
output pipes work just fine, as in
   open(FH, "dir|");
   print join("", <FH>);

So you should be able to just open an output pipe to the
print command--but which one you say? I'm running Win32
at the moment, and I'm too lazy to flick over to NT--
but I assume that a command line version is available
either natively, in the NT Resource Kit, or as a last
resort in the MKS Toolkit.

Hope that helps. Now can you proffer any help with that
Perl de{*filter*} glitch?
Mark



Sat, 09 Sep 2000 03:00:00 GMT  
 Printing from Perl on NT box

Quote:

>How do I open a filehandle for printing in Perl on NT?

>I want to be able to do something like
>open(P,"some way to designate a printer");
>print P "this string goes to printer";
>close P;

>Or - I need some way to accomplish the equivalent on NT.

>Thanks!

You apparently need to create a share for the printer in question, and open the
share for output:

open PRINTER,'>//computer_name/printer_name' or die "Dammit! $!\n";
print PRINTER $stuff_to_print;
close PRINTER;

I tried opening LPT1: for the local printer, but Perl seemed to send it
straight to the City of Lost Bytes . . .

--
                               Jeffrey R. Drumm, Systems Integration Specialist
                       Maine Medical Center - Medical Information Systems Group

"Broken? Hell no! Uniquely implemented!" - me



Sat, 09 Sep 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Checking Disk Space of Win NT Box from Linux with Perl

2. build DBI module for Perl on NT box

3. File associations for Perl on NT box

4. Perl scripting on IIS NT box

5. executing a perl script on a win-nt box

6. print dialog box

7. Write to the same line in a cmd box on NT

8. Script displaying in DOS box on NT server

9. Windows NT Open file dialog boxes - How?

10. Newbie: Help with Fork on NT box

11. How to get Windows Nt Open File Dialog Box

12. how to get date/time from NT box?

 

 
Powered by phpBB® Forum Software