http://qs1969.pair.com?node_id=1177130


in reply to Re^3: Looking for suitable spells to get open to return a filehandle from a module
in thread SOLVED: Looking for suitable spells to get open to return a filehandle from a module

What is the effect of the invocation of Symbol::gensym?

In this case, just a lazily copied expression. Quoting Symbol:

Symbol::gensym creates an anonymous glob and returns a reference to it. Such a glob reference can be used as a file or directory handle.

And that's it. It was needed in ancient perls. Perl 5.6.1 introduced autovivication for file and directory handles (see perl561delta), so Symbol::gensym is technically no longer needed. open my $fh, ... or open local $fh, ... is sufficient.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)