in reply to $. Input line number

This seems closely related to another question posted yesterday. Perhaps you could follow-up with an explanation of what your data-set looks like, and what operation you're trying to perform on it, so that now that we've seen your code we might have a crack at finding an elegant solution (if one exists).

Another thing, if your file is only 100 lines long, you know that it's not going to grow by much ever, and you're trying to perform operations on records, it might be helpful to use the Tie::File module along with the 'recsep' configuration option like this:

tie my @array, 'Tie::File', $filename, recsep => '# input for ';

This will cause individual records to be read into an array, and any modifications you perform on the array's elements will be echoed back into the file. That might simplify your script enough that the remainder of the script's file logic will wax trivial.

Hope this helps!


Dave