Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

LWP vs CGI

by atnonis (Monk)
on Apr 24, 2003 at 11:01 UTC ( [id://252845]=perlquestion: print w/replies, xml ) Need Help??

atnonis has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
LWP vs CGI *to the death!*
by perrin (Chancellor) on Apr 24, 2003 at 16:17 UTC
    LWP starts it off with a punishing GET request to CGI's belly. Whoa, look at that, CGI just took it, turned around, and responded right back at LWP with a 200 OK! This is some serious action folks!

    CGI seems to be holding back, just waiting for LWP to send it something else. Look out, LWP is getting out the big guns now! It's sending a powerful HTTPS request with a multi-part form upload! Oooh, denied by CGI's $POST_MAX setting!

    This is truly a thrilling battle, watching these two great modules pound the $VERSION numbers out of each other! We could be here all night, waiting for one of them to crack.

      :) Yet another case of "I only regret that I have but one vote to give".

Re: LWP vs CGI
by smitz (Chaplain) on Apr 24, 2003 at 11:14 UTC
    Have you looked at the docs? They do totally different things.

    • CGI serves web pages.
    • LWP retrieves web pages.

    Warning: This is a huge over-simplificaion. Check out the docs for some more info.

    Smitz
Re: LWP vs CGI
by nite_man (Deacon) on Apr 24, 2003 at 11:34 UTC
    CGI is a Perl library which provides a programming interface for creation of web pages which consist some forms and parsing their content easy using of its methods.
    LWP is a Perl library which provides a programming interface for work with WWW, especially creation of web client.
          
    --------------------------------
    SV* sv_bless(SV* sv, HV* stash);
    
Re: LWP vs CGI
by perlplexer (Hermit) on Apr 24, 2003 at 11:22 UTC
    Are you referring to CGI the module or CGI the interface?
    In either case, CGI has nothing to do with LWP.

    Follow the links, read the docs (at least the Description/Intro sections). That should clarify things.

    --perlplexer

      With all due respect, please don't direct people to the CGI101 Web site. While the information generally seems to be correct, the Perl is simply awful and the author uses the standard broken method of parsing form data.

      read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $FORM{$name} = $value; }

      Right off the top of my head, I count six bugs (or limitations, depending upon one's point of view) in that code. Dangerous stuff to recommend :)

      Cheers,
      Ovid

      New address of my CGI Course.
      Silence is Evil (feel free to copy and distribute widely - note copyright text)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-04-23 21:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found