in reply to flock - lordy me....

Another small point. The end of the code should have a truncate in it:

... print ON $ordernum; truncate ON, tell; close(ON);
Not needed in this case, but a good practice to get into, just in case the new text is shorter in length than the previous text. For the record, I agree with the "don't use unlock" crowd - let close take care of it.