http://qs321.pair.com?node_id=1230188


in reply to Re: Intermittent bug in module: File not getting deleted as expected
in thread Intermittent bug in module: File not getting deleted as expected

If I understand your problem (which is very iffy).

-M measures from start of program (kept in $^T). sleep() just make things worse. Adjust start of program. $^T = time; at or after creation of file will fix;