print (OUTFILE);
prints $_ to the filehandle. But what is $_? It's set by the while loop, so it has the value of the last time the while was checked. Which was at the end of the file, and hence $_ is undefined.
That's why you get your warning, and that's why the file is empty - undef stringified gives you the empty string.
Abigail
In reply to Re: Writing to a file: problem
by Abigail-II
in thread Writing to a file: problem
by Tricky
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |