Subject: | passThrough array context |
Date: | Mon, 11 Jul 2011 08:55:07 +1000 |
To: | bug-GD-Window [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
In passThrough mode a pass-through method call doesn't seem to keep
array context from the caller. For example foo.pl below prints
GD direct: rgb length 3
Window: rgb length 1
where I expected length 3 from the window pass-through call too.
#!/usr/bin/perl -w
use strict;
use GD;
use GD::Window;
my $im = GD::Image->new(5, 5);
my $index = $im->colorAllocate(0,0,0);
my $win = GD::Window->new($im,
0,0, 4,4,
0,0, 4,4,
passThrough => 1);
{
my @rgb = $im->rgb($index);
print "GD direct: rgb length ",scalar(@rgb),"\n";
}
{
$win->rgb($index);
$win->rgb($index);
my @rgb = $win->rgb($index);
print "Window: rgb length ",scalar(@rgb),"\n";
}