Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > CGI.pm

Reply
Thread Tools

CGI.pm

 
 
D Borland
Guest
Posts: n/a
 
      09-22-2003
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


 
Reply With Quote
 
 
 
 
Jeff 'japhy' Pinyan
Guest
Posts: n/a
 
      09-22-2003
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)

 
Reply With Quote
 
 
 
 
D Borland
Guest
Posts: n/a
 
      09-22-2003
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" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
> 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)
>



 
Reply With Quote
 
D Borland
Guest
Posts: n/a
 
      09-22-2003
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" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
> 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)
>



 
Reply With Quote
 
Helgi Briem
Guest
Posts: n/a
 
      09-22-2003
On Mon, 22 Sep 2003 16:53:15 +0100, "D Borland"
<(E-Mail Removed)> 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.
 
Reply With Quote
 
peter pilsl
Guest
Posts: n/a
 
      09-22-2003
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.velocityreviews.com/forums/(E-Mail Removed)
http://www.goldfisch.at

 
Reply With Quote
 
Trent Curry
Guest
Posts: n/a
 
      09-22-2003
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");'


 
Reply With Quote
 
Eric Bohlman
Guest
Posts: n/a
 
      09-22-2003
"D Borland" <(E-Mail Removed)> wrote in
news:4WEbb.734$(E-Mail Removed):

> 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.
 
Reply With Quote
 
Tore Aursand
Guest
Posts: n/a
 
      09-22-2003
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 <(E-Mail Removed)>

"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."
 
Reply With Quote
 
Malcolm Dew-Jones
Guest
Posts: n/a
 
      09-22-2003
Trent Curry ((E-Mail Removed)) 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments