• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

perl for loop

craigmp

n00b
Joined
May 11, 2005
Messages
45
I have a perl program that is taking some information and creating a pdf file using pdf::api2. I want it to start at 7.125 inches from the bottom and then print information on each line subtracting .125 from 7.125 until it gets to 1 inch. I can't get it to subract .125 from the 7.125. The code below works but it is subtracting 1. If i use $i-.125 it just keeps running the loop. Any suggestions to get it to subract .125 from $i ? If I print the output to the command prompt using print "$i\n" it keeps saying 7.125 Thanks for any help.

for (my $i=7.125; $i>=1; $i--)
{
$details->font($font,9);
$details->fillcolor('black');
$details->translate(.5/in, $i/in);
$details->text("1234567890");
}
 
Back
Top