CGI.pm

Discussion in 'Perl Misc' started by D Borland, Sep 22, 2003.

  1. D Borland

    D Borland Guest

    Hi folks,

    How do i go about get a parameter list from a form, without having to use
    CGI.pm?

    I was going to use this, but it's just a waste of time learning how to use
    it correctly - i mean if i wanted to read, read, read and read i would have
    just got a job in a library. It's something that i have been finding with
    perl more and more. I finished reading the Llama about a week ago, and have
    since been horrified by sheer mass of perl bits and bobs. The TMTOWTDI
    motto, is all well and fine but it also helps to badly confuse a beginner in
    language, you read a peice of text from one person and later you read
    another telling you that what you just read, isn't the best or safest way to
    do it, then later on you read that, that people don't like it that way
    either, but prefer to do this. Then there's all the modules, soom seem to
    have tried to re-create a sub-language within perl as some of the syntax for
    some modules i have seen. Then there's the book on every kind of subject
    that you can think of with perl - (i ain't rich and can't afford these, so
    perl's free but learning it's not? as the only other alternative to outdated
    or badly coded tutorials by the odd perl programmer) To be quite honest the
    only reason i chose perl over PHP was because i believe(d) that PHP was just
    a hype and when when perl6 is released everyone would come flooding back to
    perl, et cetera, but somehow i'm starting to think i chose wrong :( Maybe
    PHP was the better choice.

    Well that's a little bit of the stress perl has given me gone... sigh

    Dagmar
     
    D Borland, Sep 22, 2003
    #1
    1. Advertising

  2. On Mon, 22 Sep 2003, D Borland wrote:

    >How do i go about get a parameter list from a form, without having to use
    >CGI.pm?


    It's not easy. CGI.pm makes it easy.

    use CGI 'param';

    my @form_fields = param();

    Ta da!

    >I was going to use this, but it's just a waste of time learning how to use
    >it correctly - i mean if i wanted to read, read, read and read i would have
    >just got a job in a library.


    Heh. It's an important module, it does a lot, and it needs documentation.
    But the part you need isn't very hidden or difficult to find.

    >Maybe PHP was the better choice.


    If what you need is web-based stuff, by all means, use PHP. That's what
    it's there for.

    --
    Jeff Pinyan RPI Acacia Brother #734 2003 Rush Chairman
    "And I vos head of Gestapo for ten | Michael Palin (as Heinrich Bimmler)
    years. Ah! Five years! Nein! No! | in: The North Minehead Bye-Election
    Oh. Was NOT head of Gestapo AT ALL!" | (Monty Python's Flying Circus)
     
    Jeff 'japhy' Pinyan, Sep 22, 2003
    #2
    1. Advertising

  3. D Borland

    D Borland Guest

    I know, your right! I guess i'm just getting stressed out a bit and needed
    to let off a bit of steam, so perl got it :)

    i understand that PHP is built for web-scripting but it's then learn PHP
    aswell, and as you can see i'm most likely gonna lose the plot trying. I'll
    stick to perl and try to agree with the docs rather than argue with them.

    "What was that?", "Did you hear that?"...

    Cheers

    "Jeff 'japhy' Pinyan" <> wrote in message
    news:p...
    > On Mon, 22 Sep 2003, D Borland wrote:
    >
    > >How do i go about get a parameter list from a form, without having to use
    > >CGI.pm?

    >
    > It's not easy. CGI.pm makes it easy.
    >
    > use CGI 'param';
    >
    > my @form_fields = param();
    >
    > Ta da!
    >
    > >I was going to use this, but it's just a waste of time learning how to

    use
    > >it correctly - i mean if i wanted to read, read, read and read i would

    have
    > >just got a job in a library.

    >
    > Heh. It's an important module, it does a lot, and it needs documentation.
    > But the part you need isn't very hidden or difficult to find.
    >
    > >Maybe PHP was the better choice.

    >
    > If what you need is web-based stuff, by all means, use PHP. That's what
    > it's there for.
    >
    > --
    > Jeff Pinyan RPI Acacia Brother #734 2003 Rush

    Chairman
    > "And I vos head of Gestapo for ten | Michael Palin (as Heinrich

    Bimmler)
    > years. Ah! Five years! Nein! No! | in: The North Minehead

    Bye-Election
    > Oh. Was NOT head of Gestapo AT ALL!" | (Monty Python's Flying Circus)
    >
     
    D Borland, Sep 22, 2003
    #3
  4. D Borland

    D Borland Guest

    I know, your right! I guess i'm just getting stressed out a bit and needed
    to let off a bit of steam, so perl got it :)

    i understand that PHP is built for web-scripting but it's then learn PHP
    aswell, and as you can see i'm most likely gonna lose the plot trying. I'll
    stick to perl and try to agree with the docs rather than argue with them.

    "What was that?", "Did you hear that?"...

    Cheers

    "Jeff 'japhy' Pinyan" <> wrote in message
    news:p...
    > On Mon, 22 Sep 2003, D Borland wrote:
    >
    > >How do i go about get a parameter list from a form, without having to use
    > >CGI.pm?

    >
    > It's not easy. CGI.pm makes it easy.
    >
    > use CGI 'param';
    >
    > my @form_fields = param();
    >
    > Ta da!
    >
    > >I was going to use this, but it's just a waste of time learning how to

    use
    > >it correctly - i mean if i wanted to read, read, read and read i would

    have
    > >just got a job in a library.

    >
    > Heh. It's an important module, it does a lot, and it needs documentation.
    > But the part you need isn't very hidden or difficult to find.
    >
    > >Maybe PHP was the better choice.

    >
    > If what you need is web-based stuff, by all means, use PHP. That's what
    > it's there for.
    >
    > --
    > Jeff Pinyan RPI Acacia Brother #734 2003 Rush

    Chairman
    > "And I vos head of Gestapo for ten | Michael Palin (as Heinrich

    Bimmler)
    > years. Ah! Five years! Nein! No! | in: The North Minehead

    Bye-Election
    > Oh. Was NOT head of Gestapo AT ALL!" | (Monty Python's Flying Circus)
    >
     
    D Borland, Sep 22, 2003
    #4
  5. D Borland

    Helgi Briem Guest

    On Mon, 22 Sep 2003 16:53:15 +0100, "D Borland"
    <> wrote:

    >How do i go about get a parameter list from a form, without having to use
    >CGI.pm?


    Well, it's pretty hard. On the other hand, using the module,
    it's amazingly easy:

    use CGI qw(param);
    my @params = param();

    >I was going to use this, but it's just a waste of time learning how to use
    >it correctly - i mean if i wanted to read, read, read and read i would have
    >just got a job in a library.


    Perl requires less reading than any other programming language.
    What you *do* have to read is well organised and easily
    accessible.

    > It's something that i have been finding with
    >perl more and more. I finished reading the Llama about a week ago, and have
    >since been horrified by sheer mass of perl bits and bobs.


    It's a big language.

    >The TMTOWTDI
    >motto, is all well and fine but it also helps to badly confuse a beginner in
    >language, you read a peice of text from one person and later you read
    >another telling you that what you just read, isn't the best or safest way to
    >do it, then later on you read that, that people don't like it that way
    >either, but prefer to do this.


    Well, read the documentation then and not some random crap
    from all over the place.

    >Then there's all the modules, soom seem to
    >have tried to re-create a sub-language within perl as some of the syntax for
    >some modules i have seen. Then there's the book on every kind of subject
    >that you can think of with perl


    People write books that they hope they can sell. Shrug. So what?

    >- (i ain't rich and can't afford these, so perl's free but learning it's not?


    Yes, read the Perl documentation that comes bundled with every
    Perl distribution.


    --
    Helgi Briem hbriem AT simnet DOT is

    Excuse the munged address. My last
    e-mail address was killed by spammers.
     
    Helgi Briem, Sep 22, 2003
    #5
  6. D Borland

    peter pilsl Guest

    D Borland wrote:

    > it correctly - i mean if i wanted to read, read, read and read i would
    > have just got a job in a library.


    Its never too late ;)

    peter

    --
    peter pilsl

    http://www.goldfisch.at
     
    peter pilsl, Sep 22, 2003
    #6
  7. D Borland

    Trent Curry Guest

    Jeff 'japhy' Pinyan wrote:
    > On Mon, 22 Sep 2003, D Borland wrote:


    >
    >> Maybe PHP was the better choice.

    >
    > If what you need is web-based stuff, by all means, use PHP. That's
    > what it's there for.


    Perl works quite well for web apps too you know ;-p

    --
    Trent Curry

    perl -e
    '($s=qq/e29716770256864702379602c6275605/)=~s!([0-9a-f]{2})!pack("h2",$1)!eg
    ;print(reverse("$s")."\n");'
     
    Trent Curry, Sep 22, 2003
    #7
  8. D Borland

    Eric Bohlman Guest

    "D Borland" <> wrote in
    news:4WEbb.734$:

    > How do i go about get a parameter list from a form, without having to
    > use CGI.pm?
    >
    > I was going to use this, but it's just a waste of time learning how to
    > use it correctly - i mean if i wanted to read, read, read and read i
    > would have just got a job in a library. It's something that i have


    Well, the alternative [1] to using CGI.pm is to read all the relevant RFCs
    that deal with HTTP, as well as the entire HTML specification. And then
    code, code, code. And then test, test, test. And code some more. And
    read some more. Lather, rinse, and repeat. Seems to me like a lot more
    effort than just reading the documentation for CGI.pm.

    Lincoln Stein did all the work I just mentioned. And he chose to share the
    results of that work with others, rather than keeping it to himself, so
    others wouldn't have to repeat that work. In the Perl community we call
    this "the virtue of Laziness"; one person does some extra work, but it cuts
    down on the total amount of work the entire community has to do. Refusing
    to put in the effort to learn something like CGI.pm is what we call "the
    vice of False Laziness" because it *increases* the total amount of work
    everybody, including yourself, winds up doing.

    So take the Lazy route and learn CGI.pm! You'll be glad you did.

    [1] I'm using "alternative" to mean "a realistic different choice that
    accomplishes the same thing as the choice in question." There are pseudo-
    alternatives like cutting and pasting some badly-written code you don't
    understand from something like one of Matt Wright's early CGI scripts and
    coming up with something that might work when the phase of the moon is just
    right and you're very careful about sacrificing the goat properly.
    Building a house out of wood rather than brick is an alternative; building
    it out of cardboard is a pseudo-alternative.
     
    Eric Bohlman, Sep 22, 2003
    #8
  9. D Borland

    Tore Aursand Guest

    On Mon, 22 Sep 2003 16:53:15 +0100, D Borland wrote:
    > How do i go about get a parameter list from a form, without having to use
    > CGI.pm?


    You don't want to _not_ use CGI.pm. Reading - and parsing - web requests
    is quite hard, but CGI.pm makes it extremely easy.

    Read the CGI.pm documentation. It takes you 15 minutes to browse through
    it and learn what you're looking for. Later on, you will have a clue
    where to start reading when you encounter a CGI-related problem.


    --
    Tore Aursand <>

    "You know the world is going crazy when the best rapper is white, the best
    golfer is black, France is accusing US of arrogance and Germany doesn't
    want to go to war."
     
    Tore Aursand, Sep 22, 2003
    #9
  10. Trent Curry () wrote:
    : Jeff 'japhy' Pinyan wrote:
    : > On Mon, 22 Sep 2003, D Borland wrote:

    : >
    : >> Maybe PHP was the better choice.
    : >
    : > If what you need is web-based stuff, by all means, use PHP. That's
    : > what it's there for.

    : Perl works quite well for web apps too you know ;-p

    Yes, but it's at least as good to use php if you don't want to read the
    perl manuals.
     
    Malcolm Dew-Jones, Sep 22, 2003
    #10
  11. D Borland

    D Borland Guest

    OK, dudes i understand - I'm a lazy git, and i really gotta get my head out
    my arse and in gear!

    Maybe not in those exact words, but i understand.

    Thanks

    "Tore Aursand" <> wrote in message
    news:p...
    > On Mon, 22 Sep 2003 16:53:15 +0100, D Borland wrote:
    > > How do i go about get a parameter list from a form, without having to

    use
    > > CGI.pm?

    >
    > You don't want to _not_ use CGI.pm. Reading - and parsing - web requests
    > is quite hard, but CGI.pm makes it extremely easy.
    >
    > Read the CGI.pm documentation. It takes you 15 minutes to browse through
    > it and learn what you're looking for. Later on, you will have a clue
    > where to start reading when you encounter a CGI-related problem.
    >
    >
    > --
    > Tore Aursand <>
    >
    > "You know the world is going crazy when the best rapper is white, the best
    > golfer is black, France is accusing US of arrogance and Germany doesn't
    > want to go to war."
     
    D Borland, Sep 22, 2003
    #11
  12. D Borland

    Tore Aursand Guest

    On Mon, 22 Sep 2003 22:41:13 +0100, D Borland wrote:
    > OK, dudes i understand - I'm a lazy git, and i really gotta get my head out
    > my arse and in gear!


    While you're at it: Stop top-posting.


    --
    Tore Aursand <>

    "You know the world is going crazy when the best rapper is white, the best
    golfer is black, France is accusing US of arrogance and Germany doesn't
    want to go to war."
     
    Tore Aursand, Sep 23, 2003
    #12
  13. D Borland

    Robert Guest

    Lincoln Stein is my Hero! You need to change professions!


    "D Borland" <> wrote in message
    news:4WEbb.734$...
    > Hi folks,
    >
    > How do i go about get a parameter list from a form, without having to use
    > CGI.pm?
    >
    > I was going to use this, but it's just a waste of time learning how to use
    > it correctly - i mean if i wanted to read, read, read and read i would

    have
    > just got a job in a library. It's something that i have been finding with
    > perl more and more. I finished reading the Llama about a week ago, and

    have
    > since been horrified by sheer mass of perl bits and bobs. The TMTOWTDI
    > motto, is all well and fine but it also helps to badly confuse a beginner

    in
    > language, you read a peice of text from one person and later you read
    > another telling you that what you just read, isn't the best or safest way

    to
    > do it, then later on you read that, that people don't like it that way
    > either, but prefer to do this. Then there's all the modules, soom seem to
    > have tried to re-create a sub-language within perl as some of the syntax

    for
    > some modules i have seen. Then there's the book on every kind of subject
    > that you can think of with perl - (i ain't rich and can't afford these, so
    > perl's free but learning it's not? as the only other alternative to

    outdated
    > or badly coded tutorials by the odd perl programmer) To be quite honest

    the
    > only reason i chose perl over PHP was because i believe(d) that PHP was

    just
    > a hype and when when perl6 is released everyone would come flooding back

    to
    > perl, et cetera, but somehow i'm starting to think i chose wrong :( Maybe
    > PHP was the better choice.
    >
    > Well that's a little bit of the stress perl has given me gone... sigh
    >
    > Dagmar
    >
    >
     
    Robert, Sep 23, 2003
    #13
  14. D Borland

    Trent Curry Guest

    Malcolm Dew-Jones wrote:
    > Trent Curry () wrote:
    >> Jeff 'japhy' Pinyan wrote:
    >>> On Mon, 22 Sep 2003, D Borland wrote:

    >
    >>>
    >>>> Maybe PHP was the better choice.
    >>>
    >>> If what you need is web-based stuff, by all means, use PHP. That's
    >>> what it's there for.

    >
    >> Perl works quite well for web apps too you know ;-p

    >
    > Yes, but it's at least as good to use php if you don't want to read
    > the perl manuals.


    Well, both have good uses in this area. I really depends on what you really
    want to achieve, and which tool you'd prefer to use. I just happen to be
    more comfortable with Perl. Other people may wish to use php.

    What ever floats thy boat :)

    --
    Trent Curry

    perl -e
    '($s=qq/e29716770256864702379602c6275605/)=~s!([0-9a-f]{2})!pack("h2",$1)!eg
    ;print(reverse("$s")."\n");'
     
    Trent Curry, Sep 23, 2003
    #14
  15. D Borland

    Trent Curry Guest

    Trent Curry wrote:
    > Malcolm Dew-Jones wrote:
    >> Trent Curry () wrote:


    >>> Perl works quite well for web apps too you know ;-p

    >>
    >> Yes, but it's at least as good to use php if you don't want to read
    >> the perl manuals.

    >
    > Well, both have good uses in this area. I really depends on what you
    > really want to achieve, and which tool you'd prefer to use. I just
    > happen to be more comfortable with Perl. Other people may wish to use
    > php.
    >
    > What ever floats thy boat :)


    oops, I mis read your line. True, if you really want to make good use of
    Perl, you must know that perldoc is your friend, and not a burden.

    On that note, I've seen the docs at www.php.net, and I'd say they too would
    require getting aquainted too for any successful task in php, save maybe
    Hello World level examples...

    --
    Trent Curry

    perl -e
    '($s=qq/e29716770256864702379602c6275605/)=~s!([0-9a-f]{2})!pack("h2",$1)!eg
    ;print(reverse("$s")."\n");'
     
    Trent Curry, Sep 23, 2003
    #15
  16. D Borland

    D Borland Guest

    What r u talking about!???!!!!

    Dagmar

    "Tore Aursand" <> wrote in message
    news:p...
    > On Mon, 22 Sep 2003 22:41:13 +0100, D Borland wrote:
    > > OK, dudes i understand - I'm a lazy git, and i really gotta get my head

    out
    > > my arse and in gear!

    >
    > While you're at it: Stop top-posting.
    >
    >
    > --
    > Tore Aursand <>
    >
    > "You know the world is going crazy when the best rapper is white, the best
    > golfer is black, France is accusing US of arrogance and Germany doesn't
    > want to go to war."
     
    D Borland, Sep 23, 2003
    #16
  17. -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    "D Borland" <> wrote in
    news:BIUbb.7974$:

    > What r u talking about!???!!!!
    >


    Top-posting is the practice of writing your follow-up above the text that
    you're quoting. Most regulars here in comp.lang.perl.misc (and in
    technical newsgroups in general) find this style extremely annoying. It
    makes it difficult to read through the quoted text in chronological order.

    - --
    Eric
    $_ = reverse sort $ /. r , qw p ekca lre uJ reh
    ts p , map $ _. $ " , qw e p h tona e and print

    -----BEGIN PGP SIGNATURE-----
    Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

    iQA/AwUBP3AlK2PeouIeTNHoEQL1YwCggP086cR96Lo52PfmbWOdDH+2STQAn1Wt
    iSf1get5RliMiqfMBEtAgVXK
    =BCw6
    -----END PGP SIGNATURE-----
     
    Eric J. Roode, Sep 23, 2003
    #17
  18. -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    "D Borland" <> wrote in
    news:11Kbb.860$:

    > OK, dudes i understand - I'm a lazy git, and i really gotta get my
    > head out my arse and in gear!
    >
    > Maybe not in those exact words, but i understand.


    Well, if you choose to be lazy (a good choice, imho), read the manual for
    CGI.pm and use that module -- all of the hard work has been done for you.
    If you choose not to be lazy, by all means, redo all the work yourself.
    :)

    - --
    Eric
    $_ = reverse sort $ /. r , qw p ekca lre uJ reh
    ts p , map $ _. $ " , qw e p h tona e and print

    -----BEGIN PGP SIGNATURE-----
    Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

    iQA/AwUBP3Al/WPeouIeTNHoEQKo3QCfUlw/c6CGmZnah0NtUwfBwrIc3YwAmgMP
    YF4EM2nq1JkXUOlkhkJQozFn
    =0cOj
    -----END PGP SIGNATURE-----
     
    Eric J. Roode, Sep 23, 2003
    #18
  19. D Borland

    Juha Laiho Guest

    "Trent Curry" <> said:
    >On that note, I've seen the docs at www.php.net, and I'd say they too would
    >require getting aquainted too for any successful task in php, save maybe
    >Hello World level examples...


    They do require -- worst thing being that the single set of
    documentation tries to cover several versions, and so contains
    examples (and even syntax/usage descriptions) that either require
    older or newer version of PHP that you happen to be using. And
    of course, different parts of the documentation are primarily
    written for different PHP versions.
    --
    Wolf a.k.a. Juha Laiho Espoo, Finland
    (GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
    PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
    "...cancel my subscription to the resurrection!" (Jim Morrison)
     
    Juha Laiho, Sep 23, 2003
    #19
  20. D Borland

    Trent Curry Guest

    Malcolm Dew-Jones wrote:
    > Trent Curry () wrote:
    >> Jeff 'japhy' Pinyan wrote:
    >>> On Mon, 22 Sep 2003, D Borland wrote:

    >
    >>>
    >>>> Maybe PHP was the better choice.
    >>>
    >>> If what you need is web-based stuff, by all means, use PHP. That's
    >>> what it's there for.

    >
    >> Perl works quite well for web apps too you know ;-p

    >
    > Yes, but it's at least as good to use php if you don't want to read
    > the perl manuals.


    Just a little note I wanted to add:

    If you prefer the front end inline code style like php or asp, Perl can do
    it too: Apache::ASP; asp using Perl for the host language. :)

    --
    Trent Curry

    perl -e
    '($s=qq/e29716770256864702379602c6275605/)=~s!([0-9a-f]{2})!pack("h2",$1)!eg
    ;print(reverse("$s")."\n");'
     
    Trent Curry, Sep 23, 2003
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jürgen Exner

    Re: CGI Perl "use CGI" statement fail

    Jürgen Exner, Jul 31, 2003, in forum: Perl
    Replies:
    0
    Views:
    1,480
    Jürgen Exner
    Jul 31, 2003
  2. Shailan
    Replies:
    2
    Views:
    1,069
    Shailan
    Dec 15, 2003
  3. John Smith
    Replies:
    0
    Views:
    3,162
    John Smith
    May 15, 2006
  4. LarsenMTL
    Replies:
    4
    Views:
    782
    Eric Walstad
    Nov 4, 2004
  5. praba kar

    Python-cgi or Perl-cgi script doubt

    praba kar, Jul 30, 2005, in forum: Python
    Replies:
    1
    Views:
    685
    Michael Sparks
    Jul 30, 2005
Loading...

Share This Page