#!/usr/local/bin/perl
open (COUNT, "countqbas");   # open "countf" counter file
$counter = <COUNT>;          # input value from file
close (COUNT);               # close file (primarily to "re-set")
open (COUNT, ">countqbas");  # open "countf" for 'output'
print COUNT +($counter+1);   # increment value of counter by one & write
close (COUNT);               # close file