$ 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: $!";
|