local $fh erases the content of $fh. And even if it didn't, open doesn't takea variable name for its first argument (just a variable).
You can simply use
open(my $fh, '<', 'test.out')
Open returns a new anonymous file handle in $fh every time.
In reply to Re: Generate unique file handles
by ikegami
in thread Generate unique file handles
by alih110
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |