> -----Original Message-----
> From: Clinton [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 27, 2001 3:42 AM
> To: [EMAIL PROTECTED]
> Subject: looping in PDF::Create
> 
> 
> Hi
> I'm using PDF::Create and trying to loop thru an array hoping 
> to print each
> element of the array. I only get the first element with this 
> snippet. Must
> be doing something silly but I can't see it.
> 
> my @array = ("50","100","150","200");
> for (my $i=0; $i<=$#array; $i++){
> $page->stringc($f2, 40, 50, $array[$i], $array[$i]);
> }

I don't know anything about PDF::Create, but you should
try to get away from writing C-style loops in favor 
of the cleaner Perl idioms:

   $page->stringc($f2, 40, 50, $_, $_) for @array;

Are 40, 50 coordinates? Perhaps you are writing all the
values to the same location.

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

Reply via email to