in reply to Change a line in a file

Try putting a or die ... test on open (T, "+<$trace"). Are you perhaps trying to read and write the same file as you have open elsewhere?

It's generally recommended to use the three parameter version of open - it's easier to read and safer.


Perl reduces RSI - it saves typing