in reply to Re: Almost certainly a module documentation issue
in thread Almost certainly a module documentation issue

This worked. This code ran, and the result was acceptable to Email::Sender::Transport::Print->new().

In some ways I'm more confused than ever, though, because when I display the filehandle in perldb the new code shows me

DB<4> x $sm 0 IO::Handle=GLOB(0x80695a1c8) -> *Symbol::GEN0 FileHandle({*Symbol::GEN0}) => fileno(7) DB<5> n

while isn't IO::Handle anywhere, and duplicates the FileHandle shown in the original code (but wrapped a level down). Still, it's clearly different, and it works, so I won't complain :-).

Replies are listed 'Best First'.
Re^3: Almost certainly a module documentation issue
by haukex (Archbishop) on Oct 15, 2017 at 11:04 UTC
    while isn't IO::Handle anywhere, and duplicates the FileHandle shown in the original code

    It's an object of type IO::Handle, as shown in the first line of the dump. Basically IO::Handle->new boils down to blessing a new symbol as returned by Symbol::gensym (which explains the second line of the dump) into the class IO::Handle (source). If you step through the code, you should see the following:

    **Before** the open() 0 IO::Handle=GLOB(0x1948fb2) -> *Symbol::GEN0 **After** the open() 0 IO::Handle=GLOB(0x1948fb2) -> *Symbol::GEN0 FileHandle({*Symbol::GEN0}) => fileno(7)

    So the FileHandle appears to be the result of opening the file.