in reply to help for accept sys call

I'm having a hard time guessing what module accept() is a method of. Can you tell us so that we (I) can read the module's POD to see if an answer lies within?

Also, what exactly do you mean by "some junk value"? That may be valuable information (and then again it may not, but until we see we won't know).

Ready to try to find an answer...


Dave

Replies are listed 'Best First'.
Re^2: help for accept sys call
by merlyn (Sage) on Mar 05, 2005 at 15:59 UTC
    I'm having a hard time guessing what module accept() is a method of. Can you tell us so that we (I) can read the module's POD to see if an answer lies within?
    perldoc -tf accept says (since it is a core operator):
    accept NEWSOCKET,GENERICSOCKET Accepts an incoming socket connect, just as the accept(2) +system call does. Returns the packed address if it succeeded, fal +se otherwise. See the example in "Sockets: Client/Server Communication" in perlipc. On systems that support a close-on-exec flag on files, the + flag will be set for the newly opened file descriptor, as deter +mined by the value of $^F. See "$^F" in perlvar.

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.

      Thanks merlyn. :) It looked to me like an object method so I went diving into CPAN to figure out what module it might be.

      So now I have a question which isn't evident in perlfunc: What's going on with the usage in this OP's example? It looks to me like accept() is being used as an object method, which means that the first argument passed to accept() will be the object's reference, rather than NEWSOCKET. I've probably missed something else elementary, but a little clarification would set my mind at ease. :)

      Or is it possible that accept() is a method of some module, and not the core builtin?


      Dave

        IO::Socket or one of it's subclasses perhaps?


        Examine what is said, not who speaks.
        Silence betokens consent.
        Love the truth but pardon error.