http://www.perlmonks.org?node_id=716060


in reply to Re: Open Files in Unix
in thread Open Files in Unix

You still haven't fixed the quoting to backticks on your second find command like ikegami pointed out in the very first reply.

Addendum: And if you bothered checking the return value from open on the next line and printing out the error message you might have noticed this yourself . . .

Continuing: And trying to read from a filehandle you've opened for writing (well, we'll presume that you eventually correct the other errors to that point) with the line @array1 = <FILE> after the unchecked open is meaningless. You either need to open the file for reading and writing and do some seek magic to rewind it, or (more simply) write the updated contents to a new file and rename over the original.

The cake is a lie.
The cake is a lie.
The cake is a lie.