For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > February 2005 > Send file to printer









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Send file to printer
Brian Volk

2005-02-25, 8:56 pm

Hi All,

I have been searching Google for a while now and I can not find how to send
a file to the printer. For example I use the script below to get Material
Safety Data Sheets and store them in a directory ..where I can easily print
them out manually but what I would really like to do is send them to a
printer using a perl script. Can someone pls point me in the direction of
some documentations on this subject...

FYI, I'm using windows ... only at work though! :~)

Thanks!

use strict;
use warnings;
use LWP::Simple;

my $urlfile = 'C:/brian/MSDS/url_20.txt';
my $itemfile = 'C:/brian/MSDS/file_20.txt' ;

open(URL, "<", $urlfile) or die "couldn't read urls: $!";
open(ITEM, "<", $itemfile) or die "couldn't read items: $!";

my @urls = <URL> ;
my @items= <ITEM>;

close(URL);
close(ITEM);

while (@urls) {
my $url = shift(@urls);
chomp $url;
my $file = shift(@items);
chomp $file;

# this line will get and store the msds
my $msds = getstore($url,$file);
}


Brian Volk
HP Products
317.298.9950 x1245
<mailto:bvolk@hpproducts.com> bvolk@hpproducts.com



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com