#!/usr/bin/perl -w use strict; use warnings; use SVG; # create an SVG object my $svg= SVG->new(width=>800,height=>600); my $cont_w = 500; my $cont_h = 100; my $cont_tbh = 19; # a 10-pointsaw-tooth pattern drawn with a path definition my $xv = [6, "C 2.676", 0, 0, 0, $cont_w, $cont_w, "C $cont_w", $cont_w - 2.676, $cont_w - 6, 6]; my $yv = [0, 0, 2.676, 6, $cont_tbh, $cont_tbh, 6, 2.676, 0, 0, 0]; my $points = $svg->get_path( x => $xv, y => $yv, -type => 'path', -closed => 'true' #specify that the polyline is closed ); my $tag = $svg->path( %$points, id => 'pline_1', style => { 'fill-color' => 'green' } ); # now render the SVG object, implicitly use svg namespace print $svg->xmlify; ####