Unfortunately, $! is garbage in that example.
From unlink:
Deletes a list of files. On success, it returns the number of files it successfully deleted. On failure, it returns false and sets $! (errno):
One of the examples at the perldoc page for unlink shows using $! with warn() in a foreach loop. Why shouldn't $! be used in this case?
In reply to Re^3: Unlinking a file when the file doesnt exist
by Gulliver
in thread Unlinking a file when the file doesnt exist
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |