• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 21. SVG and Perl > Generating SVG Using print Statements

Generating SVG Using print Statements

Perhaps the most straightforward way to generate SVG in Perl is to use the venerable print statement. For small files, this option may be your best choice. This approach uses very little memory and is undoubtedly the fastest way to generate any text file in Perl.

Regardless of which approach you take to generating SVG with Perl, you will need to let the client's browsers know that you are serving up an SVG document. Listing 21.20 accomplishes this by sending the Content-type header with a value of image/svg+xml.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint