It isn't a safe thing to do but you could close the file after reading it into your array. Then re-open it for output open $fh, ">", "file.txt" or similar which will clobber (clear the contents) your file then write to it. The danger is that a minor mistake in your program could wipe out or mangle the original file. You could write to a test file until you finish debugging.
In reply to Re^5: trouble with regular expressions
by Lotus1
in thread trouble with regular expressions
by programmer.perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |