Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Almost certainly a module documentation issue

by dd-b (Monk)
on Oct 14, 2017 at 20:24 UTC ( [id://1201381]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1201381]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-16 10:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found