Subject: | passThrough return value on first method call |
Date: | Mon, 11 Jul 2011 08:42:13 +1000 |
To: | bug-GD-Window [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
When using the passThrough=>1 option, the first call to a passed-through
method doesn't seem to give the return value from the underlying GD.
For example the foo.pl below prints
from GD directly: index='0'
from Window: index=''
from Window: index='2'
where I expected index='1' in the middle.
It looks like the AUTOLOAD() func makes the call to the new passthrough
method, but doesn't return the return value from there.
#!/usr/bin/perl -w
use strict;
use GD;
use GD::Window;
my $im = GD::Image->new(100, 100);
my $win = GD::Window->new($im,
0,0, 99,99,
0,0, 99,99,
passThrough => 1);
{
my $index = $im->colorAllocate(0,0,0);
print "from GD directly: index='$index'\n";
}
{
my $index = $win->colorAllocate(0,0,0);
print "from Window: index='$index'\n";
}
{
my $index = $win->colorAllocate(0,0,0);
print "from Window: index='$index'\n";
}