Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: piping to lp is broken after perl upgrade

by GrandFather (Saint)
on Oct 13, 2009 at 00:34 UTC ( [id://800825]=note: print w/replies, xml ) Need Help??


in reply to piping to lp is broken after perl upgrade

I don't see an issue in the code you've shown except that you're not using strictures (use strict; use warnings;). It wouldn't surprise me a great deal to find that there is something that was waiting in your heredoc to bite and has now bitten. It may help if you:

my $prolog = << 'ENDPROLOG';

so interpolation doesn't happen.


True laziness is hard work

Replies are listed 'Best First'.
Re^2: piping to lp is broken after perl upgrade
by myuserid7 (Scribe) on Oct 14, 2009 at 20:51 UTC
    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: $!";
      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...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://800825]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-04-24 07:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found