> 
> Another guess - maybe the problem is the whitespaces in the printer
> name. Try escaping them using backslashes:
> copy ($source_file, '//HP-EXCH/HP\ LaserJet\ 4100(IS)');
> 
> I would also try changing the single quotes to double quotes.
> 
> Hope this helps,
> -- 
> Offer Kaye
> 

I tried that too.. :~) I'm now working w/ the Net::Printer module and I
think I'm getting closer.  The error I'm getting is below..  Not too sure
what Unknow error means.... but I'll keep searching.

Thanks for your help.

-- begin

C:\brian\Perl>perl send_to_printer.pl
Use of uninitialized value in sprintf at C:/Perl/site/lib/Net/Printer.pm
line 742.
Couldn't send data: Unknown error at send_to_printer.pl line 39
ERROR:Net::Printer[168]: Error Occured sending data to printer
at send_to_printer.pl line 39
 
#!/usr/local/bin/perl 
 
use strict;
use warnings;
# use File::Copy;
use Net::Printer;
 
my $source_folder = "C:/brian/text_files";
 
my $dest_file = "C:/brian/test/item_file1.txt";
open ITEMFILE, ">$dest_file";
 
opendir(FILES,$source_folder);
my @files_to_process_list = grep {!(/^\./) && -f "$source_folder/$_"} 
readdir(FILES);
closedir (FILES);
 
foreach my $source_file(@files_to_process_list) {
 
    print ITEMFILE "$source_file\n";
 
my $lineprinter = new Net::Printer (
         filename        => "C:/brian/test/item_file1.txt",
         printer          => "HP4100-IS",   # this is the Share name
         server           => "HP-EXCH",
         port              => "515"'  
         #lineconvert => "NO"   
      
        );
 
                 
my $result = $lineprinter->printfile();  
 
}     

-- end
 
Brian Volk

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to