Localizing a typeglob to get a scope-bound filehandle is not necessarily a good idea for various other reasons as well. Why not simply:
open my($fh), "<", $filename or die "open $filename: $!$/";
If that's an issue due to old Perl version, there's still Symbol::gensym, and a short wrapper function will make its use nearly as concise as the above snippet.
Localizing a typeglob to get a scope-bound filehandle is not necessarily a good idea for various other reasons as well.
Oh. Didn't know there were other possible problems. What are they?
I know of the gensym solution for early perls - but since 99% of the time overriding the non-IO bits of the glob hasn't been an issue for me I stuck with the local method when I couldn't autovivify the filehandle.
Curious to know what the other possible pitfalls are.