CGI.pm

D

D Borland

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
 
J

Jeff 'japhy' Pinyan

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.
 
D

D Borland

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
 
D

D Borland

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
 
H

Helgi Briem

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.
 
T

Trent Curry

Jeff said:
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");'
 
E

Eric Bohlman

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.
 
T

Tore Aursand

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 <[email protected]>

"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."
 
M

Malcolm Dew-Jones

Trent Curry ([email protected]) 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.
 
D

D Borland

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
 
T

Tore Aursand

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 <[email protected]>

"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."
 
T

Trent Curry

Malcolm said:
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");'
 
T

Trent Curry

Trent said:
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");'
 
D

D Borland

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

Dagmar

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


--
Tore Aursand <[email protected]>

"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."
 
E

Eric J. Roode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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-----
 
E

Eric J. Roode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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-----
 
J

Juha Laiho

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.
 
T

Trent Curry

Malcolm said:
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");'
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top