Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: select and IO::Handle

by runrig (Abbot)
on Aug 04, 2001 at 01:30 UTC ( #102172=note: print w/replies, xml ) Need Help??


in reply to select and IO::Handle

IO::Scalar does not return an IO::Handle, it returns a blessed hash reference. The author said he tried to subclass IO::Handle, but ran into 'xxx on unopened filehandle' warnings. You have to use methods on an IO::Scalar object, unless you are using the tied interface, but then you would be using a tied filehandle/glob.

I'm actually working on a patch for IO::Scalar so that it will return a blessed glob reference with a tied glob so that it will behave more like a real filehandle, and things that return IO::Scalar objects can be passed to things which expect filehandles. If there's a better fix, I'd be glad to hear of it :-)

Update: IO::Scalar now returns a blessed glob reference and so the returned object behaves more like a real filehandle. However, modern perls let you open a filehandle directly to a scalar, which makes these sorts of modules obsolete.

Replies are listed 'Best First'.
Re: Re: select and IO::Handle
by John M. Dlugosz (Monsignor) on Aug 04, 2001 at 02:17 UTC
    I was just talking to the author, too.

    A better fix: Only implement actual methods for the TIE. Also have a function to create one and return an IO::Handle to it as one call.

    While you're at it, note that WRITE method is missing.

    —John

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://102172]
help
Chatterbox?
[LanX]: Oh yes true, he lost his accent! xD
[Eily]: and since his name is a modified version of astérisque (asterisk), which is a typographical symbol, I think it's even funnier that he would lose a diacritic
[Eily]: the pun doesn't work so well with "he lost a diacritic" though :P
[LanX]: Obelix might offer to find it again ...
[LanX]: not much to translate anyway since Goscinny died
[Eily]: https://en. wikipedia.org/ wiki/List_of_Aster ix_characters some of the names were changed to include a new pun
[LanX]: sure some are even funnier now
[LanX]: some lost because they were not translated like Epidemais

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (14)
As of 2017-05-24 15:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?