http://qs321.pair.com?node_id=245291


in reply to GD, arrays, and Polygons

You execute the first loop twice with $x set to 0 and 1. You build entries 0 and 1 in @para1 and @para2. When you leave the first loop, $x = 2. You then attempt to execute the second loop with $x set to 2 but you never defined that entry in the arrays. Move the decrement to the beginning of the loop.

while ($x >= 0){ $x--; $image->filledPolygon($para1[$x], $black); $image->filledPolygon($para2[$x], $yellow); }
--- print map { my ($m)=1<<hex($_)&11?' ':''; $m.=substr('AHJPacehklnorstu',hex($_),1) } split //,'2fde0abe76c36c914586c';

Replies are listed 'Best First'.
Re: Re: GD, arrays, and Polygons
by neilwatson (Priest) on Mar 23, 2003 at 17:38 UTC
    Ack, I'm spending to much time performing Windows support. Thanks.

    Neil Watson
    watson-wilson.ca