"Clint" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I was able to get it fixed. Here's what I did in case someone else runs
into
> the same problem:
>
> Changed from these lines:
>  my $image = new GD::Image(401,201);  (btw: this line is different than
what
> is found in the text)
>  $image->trueColor();
>
> to these lines:
> my $image = new GD::Image->new(401,201);

Sometimes I hate indirect object notation. It looks slick, but there are a
few gotchas involved.

You can get rid of that first new and it will still work:

[EMAIL PROTECTED] trwww]$ perl -MO=Deparse
use GD::Graph;
$image = new GD::Image->new(401, 201);
Ctrl-D
$image = 'GD::Image'->new->new(401, 201);
- syntax OK

The line after Ctrl-D is output by the Deparse module to show how perl
interpreted your statement. Your code works, but only by chance.

Todd W.

>
> Clint
>
> On Wednesday June 4 2003 10:51 pm, Clint wrote:
> > I am new to Perl and trying to learn graphics by the examples given in
> > Shaun Wallace's Perl Graphics Programming.  I'm using Perl 5.8 and have
> > installed GD and GD::Graph using CPAN.  I've checked to verify both
modules
> > are installed using a "findmodules" script I found elsewhere, and here
is a
> > snippet with the versions:

<snip />


Todd W.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to