in reply to what does "res" do?

Your code appears to have come from GUI with HTTP::Daemon. A couple of lines prior to the one you cited is a line reading use CGI::Simple;. Do the Docs for CGI::Simple say about a res method? Do the Docs for other modules in the code sample talk about a res method or a res() function call?

This is a somewhat circumlocutious way of saying "It All Depends on the context, Grasshopper". You research the code, given the clues available, and determine the truth based on your discoveries.... (And don't forget that the "It's a Typo!" card is often played in code you find on the Web.)

----
I Go Back to Sleep, Now.

OGB

Replies are listed 'Best First'.
Re^2: what does "res" do?
by graff (Chancellor) on Jul 06, 2008 at 14:09 UTC
    Your code appears to have come from GUI with HTTP::Daemon. A couple of lines prior to the one you cited is a line reading use CGI::Simple;...

    This is a ... way of saying "It All Depends on the context, Grasshopper"...

    Hmm. But what about that bit on the cited page (GUI with HTTP::Daemon) that says:

    sub res{ HTTP::Response->new( RC_OK, OK => [ 'Content-Type' => 'text/html' ], shift ) }
    I suspect this would override any definition for "res" that might be found in CGI::Simple or any other module used by that code snippet, and eliminate any ambiguity about what "res" means in the given context. (So all that remains is to figure out what HTTP::Response->new() does, and we can only hope that davegx will be able to work that out.)

    Then again, it's possible the OP was quoting from some other source... who knows?