Always use strictures (use strict; use warnings;). Try it. It will help!
In reply to Re: Deleting or unlinking a file by GrandFather in thread Deleting or unlinking a file by Anonymous Monk