#!/usr/local/bin/perl use GD; use CGI ':standard'; # This creates a Web GIF image on the fly # create a new image $im = new GD::Image(1000,100); # allocate some colors $white = $im ->colorAllocate(255,255,255); $black= $im ->colorAllocate(0,0,0); $red = $im ->colorAllocate(255,100,0); $blue= $im ->colorAllocate(0,150,255); $yellow= $im ->colorAllocate(255,200,0); $pink= $im ->colorAllocate(150,0,150); $im->filledRectangle(10,5,990,15,$pink); $im->arc(10,10,10,10,0,360,$black); $im->fill(10,10,$white); $im->arc(990,10,10,10,270,90,$black); $im->fillToBorder(990,10,$black,$pink); # Convert the image to GIF and print it on standard output #binmode STDOUT; print "Content-type: image/gif\n\n"; print $im->gif; #### [Fri Jul 29 00:25:57 2005] [error] [client 127.0.0.1] Premature end of script headers: /home/nagesh /apache/cgi-bin/simpleImage.cgi Can't locate GD.pm in @INC (@INC contains: /usr/local/lib/perl5/5.8.6/i686-linux /usr/local/lib/per l5/5.8.6 /usr/local/lib/perl5/site_perl/5.8.6/i686-linux /usr/local/lib/perl5/site_perl/5.8.6 /usr/ local/lib/perl5/site_perl .) at /home/nagesh/apache/cgi-bin/simpleImage.cgi line 3. BEGIN failed--compilation aborted at /home/nagesh/apache/cgi-bin/simpleImage.cgi line 3.