use strict; use warnings; my @COLOR = ( "0 0 0", "0 0 1", "0 1 0", "0 1 1", "1 0 0", "1 0 1", "1 1 0", "1 1 1", ); my $postscript = << 'END_POSTSCRIPT'; %! 72 72 scale .25 .25 translate /Courier findfont .095 scalefont setfont END_POSTSCRIPT my $sy1 = 1; my $color = 0; for my $y (1 .. 148) { my $sy = $sy1; $sy1 %= 10; for my $x (1 .. 130) { my $_x = $x * .060; my $_y = $y * .070; $postscript .= "$COLOR{$color} setrgbcolor\n"; $postscript .= "$_x $_y moveto ($sy) show\n"; $sy = ($sy + 1) % 10; $color = ($color + 1) % 8; } } open '|-', my $lp, 'lp' or die "Couldn't spawn lp: $!\n"; print $lp $postscript;