my $v_count = 0; for my $var (@vars) { if(($v_count % $LIMIT) == 0) { print "\ndirective: "; } print &munge_var($var), " "; } print "\n";