http://www.perlmonks.org?node_id=801207


in reply to Re: piping to lp is broken after perl upgrade
in thread piping to lp is broken after perl upgrade

Thanks for your reply.

I created a files called test.ps.

$ cat test.ps %!PS /Courier findfont 20 scalefont setfont 72 500 moveto (Hello world!) show showpage
If I send it to the printer, it works. I get a Hello World.

So here is a recreation of the script that is failing.

#!/opt/csw/bin/perl -w use strict; use warnings; my $prolog = <<ENDPROLOG; %!PS /Courier findfont 20 scalefont setfont 72 500 moveto (Hello world!) show showpage ENDPROLOG my $PRINT_CMD = '/usr/bin/lp -o nobanner'; open my $output, '|-', $PRINT_CMD or die "Can't open pipe to $PRINT_CMD: $!"; print $output $prolog; close $output or warn "Error while closing pipe to $PRINT_CMD: $!";

Replies are listed 'Best First'.
Re^3: piping to lp is broken after perl upgrade
by myuserid7 (Scribe) on Oct 15, 2009 at 22:15 UTC
    I ended up abandoning the use the csw perl for this script. Instead, I pulled the 5.8.9 source and complied it on my Solaris 10 machine using gcc4.

    I pointed the test script at the new compile and it started working.

    Sadly, I am not that confident in the blastwave perl now. Surely just paranoia but once bitten...