#!/usr/bin/perl -w # Example 11-5. Generate a random collection of lines, boxes, arcs use strict; use PostScript::Elements; my $e = new PostScript::Elements; my $r = rand(25); for (my $i=0; $i<= $r; $i++) { $e->addArc(points => [rand(612), rand(792), rand(200), rand(360), rand(360)], linewidth => rand(8) ); $e->addBox(points => [rand(612), rand(792), rand(200), rand(200)], linewidth => rand(8) ); $e->addLine(points => [rand(612), rand(792), rand(200), rand(200)], linewidth => rand(8) ); } open OUT, ">example11-5.ps" or die "Couldn't open example11-5.ps: $!"; print OUT $e->Write(); close OUT;