# Four tabstop locations: my @colpos = (8, 24, 36, 45); while (....) { my @cols = split/\t/, get_next_string(); # Print each column at its tabstop for (my $i=0; $i < @colpos; ++$i) { $pages[$page_number]->string($f2, 8, $colpos[$i], $y, $cols[$i] ); } }