timpoiko has asked for the wisdom of the Perl Monks concerning the following question:

Hello all Monks. I wanted to take GD:SVG in use, so I wrote man GD::SVG and read it. I found a piece of code, so I took it and tried to run.
#!/usr/bin/perl use strict; use GD::Simple; GD::Simple->class('GD::SVG'); my $img = GD::Simple->new(500,500); $img->bgcolor('white'); $img->fgcolor('blue'); my $g1 = $img->newGroup('circle in square'); $g1->rectangle(100,100,400,400); $g1->moveTo(250,250); my $g2 = $g1->newGroup('circle and boundary'); $g2->fgcolor('black'); $g2->bgcolor('red'); $g2->ellipse(200,200); print $img->svg;
However, only outcome from this is:
$ perl test.pl Can't locate auto/GD/newGroup.al in @INC (@INC contains: /etc/perl /us +r/local/lib/x86_64-linux-gnu/perl/5.20.0 /usr/local/share/perl/5.20.0 + /usr/lib/x86_64-linux-gnu/perl5/5.20 /usr/share/perl5 /usr/lib/x86_6 +4-linux-gnu/perl/5.20 /usr/share/perl/5.20 /usr/local/lib/site_perl . +) at /usr/lib/x86_64-linux-gnu/perl5/5.20/GD/Simple.pm line 1007.
Googling does not help at all and I can't found this "newGroup.al" from the CPAN nor Debian's package repositories. So what I can to do to get this example code working?

Replies are listed 'Best First'.
Re: newGroup.al is missing
by toolic (Bishop) on Sep 15, 2014 at 13:35 UTC
    I also get this error when I run your code, which is a copy of the code in GD::SVG for which the module author states:
    Finally, here is a fully worked example of using the GD::Simple module to make the syntax cleaner:

    This should be reported as an issue.

    I was able to run this code example from the POD without error:

    use GD::SVG; my $img = GD::SVG::Image->new(500,500); my $white = $img->colorAllocate(255,255,255); my $black = $img->colorAllocate(0,0,0); my $blue = $img->colorAllocate(0,0,255); my $red = $img->colorAllocate(255,0,0); $img->startGroup('circle in square'); $img->rectangle(100,100,400,400,$blue); $img->startGroup('circle and boundary'); $img->filledEllipse(250,250,200,200,$red); $img->ellipse(250,250,200,200,$black); $img->endGroup; $img->endGroup; print $img->svg;