$linecounter = 1; $records = in{'records'}; OPEN FILE while ($linecounter <= $records) { $thiscost = in{'COST_$linecounter'} * 100; print FILE in{'REPORTID_$linecounter'}; # I know this doesn't work but it is what I need print FILE $thiscost; $linecounter++; } CLOSE FILE