How to get the multiselect select box or checkbox element values WITHOUT using CGI module

How to get the multiselect select box or checkbox element values WITHOUT using CGI module

am 30.09.2011 07:31:43 von Rajeev Prasad

--963425777-1445839830-1317360703=:21462
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Hi,  =0Awithout using CGI.pm how can i collect the values of a multisel=
ect element?  =0Asay for e.g.:  =0A< select name=3D"hobbies" id=3D"=
hobbies" multiple>=0A=0A=0A=0A=0A=0A< /se=
lect>  =0Awhen the form is submitted, i have to get the selected values=
in an array. how can i do that?      =0A*if you are curious, (=
as per my understanding) even though CGI.pm would make it easy to get value=
s out of parameters passed to the script by the web form. I would still hav=
e to do validation of values passed seperately. so why should i use a big m=
odule just to collect form data? i am using TT to display the form/HTML and=
javascript to validate input.
--963425777-1445839830-1317360703=:21462--

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

am 30.09.2011 07:43:55 von Octavian Rasnita

From: "Rajeev Prasad"
Hi,

without using CGI.pm how can i collect the values of a multiselect element?

say for e.g.:

< select name="hobbies" id="hobbies" multiple>






< /select>

when the form is submitted, i have to get the selected values in an array.
how can i do that?



*if you are curious, (as per my understanding) even though CGI.pm would make
it easy to get values out of parameters passed to the script by the web
form. I would still have to do validation of values passed seperately. so
why should i use a big module just to collect form data? i am using TT to
display the form/HTML and javascript to validate input.

**
It depends if the form is submitted using GET or POST and it is much harder
because you will need to do aditional work to decode the URL-encoded
elements, and you may make errors.

If you don't want to use CGI because is too big, you may want to use
CGI::Simple.

It doesn't matter if you validate the data using JS client side. It should
be also validated server-side also, but this has nothing to do with the way
you get the data from browser.

Octavian


--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

am 30.09.2011 08:41:33 von Rajeev Prasad

--963425777-1021191742-1317364893=:53355
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

thx Octavian,  =0Ait looks nice, but not much lighter then CGI.pm. foll=
owing is the size=A0of ubuntu packages. will this be the size in memory onc=
e loaded?  =0Athe data is coming as POST. i am also thinkng to send it =
as JSON (later).    Download libcgi-simple-perl=0ADownload for all =
available architectures=0AArchitecture=0APackage Size=0AInstalled Size=0AFi=
les=0Aall146.2 kB 460.0 kB [list of files]      =0ADownload li=
bcgi-pm-perl=0ADownload for all available architectures=0AArchitecture=0APa=
ckage Size=0AInstalled Size=0AFiles=0Aall220.1 kB 616.0 kB [list of files] =
=0A________________________________=0AFrom: Octavian Rasnita a@gmail.com>=0ATo: Rajeev Prasad ; beginners@perl.org=
=0ASent: Friday, September 30, 2011 12:43 AM=0ASubject: Re: How to get the =
multiselect select box or checkbox element values WITHOUT using CGI module=
From: "Rajeev Prasad" =0AHi, without using C=
GI.pm how can i collect the values of a multiselect element? say for e=
..g.: < select name=3D"hobbies" id=3D"hobbies" multiple>=0A=0A=0A=0A=0A=
=0A=0A< /select> when the form is subm=
itted, i have to get the selected values in an array. how can i do that?=0A=
=0A*if you are curious, (as per my understanding) even though CGI.pm =
would make it easy to get values out of parameters passed to the script by =
the web form. I would still have to do validation of values passed seperate=
ly. so why should i use a big module just to collect form data? i am using =
TT to display the form/HTML and javascript to validate input. **=0AIt =
depends if the form is submitted using GET or POST and it is much harder be=
cause you will need to do aditional work to decode the URL-encoded elements=
, and you may make errors. If you don't want to use CGI because is too=
big, you may want to use CGI::Simple. It doesn't matter if you valida=
te the data using JS client side. It should be also validated server-side a=
lso, but this has nothing to do with the way you get the data from browser.=
Octavian =0A-- To unsubscribe, e-mail: beginners-unsubscribe@per=
l.org=0AFor additional commands, e-mail: beginners-help@perl.org=0Ahttp://l=
earn.perl.org/
--963425777-1021191742-1317364893=:53355--

Re: How to get the multiselect select box or checkbox elementvalues WITHOUT using CGI module

am 30.09.2011 09:27:00 von Shlomi Fish

Hi Rajeev,

On Thu, 29 Sep 2011 23:41:33 -0700 (PDT)
Rajeev Prasad wrote:

> thx Octavian,
>  
> it looks nice, but not much lighter then CGI.pm. following is the size=C2=
=A0of ubuntu packages. will this be the size in memory once loaded?

First of all, in addition to CGI.pm and CGI::Simple, there's also CGI-Minim=
al:

http://search.cpan.org/dist/CGI-Minimal/

I've successfully used it here:

http://www.shlomifish.org/humour/fortunes/show.cgi?mode=3Dra ndom

Otherwise, the size in memory depends on somewhat different factors from th=
ose
of the Ubuntu package size. Best way to determine it is to measure it.

Why are you worried about the memory size? Is this
http://c2.com/cgi/wiki?PrematureOptimization ?

Regards,

Shlomi Fish

>  
> the data is coming as POST. i am also thinkng to send it as JSON (later).
>  
>  Download libcgi-simple-perl
> Download for all available architectures
> Architecture
> Package Size
> Installed Size
> Files
> all146.2 kB 460.0 kB [list of files]=20
>  
>  
>  
> Download libcgi-pm-perl
> Download for all available architectures
> Architecture
> Package Size
> Installed Size
> Files
> all220.1 kB 616.0 kB [list of files]=20
>=20
>=20
> ________________________________
> From: Octavian Rasnita
> To: Rajeev Prasad ; beginners@perl.org
> Sent: Friday, September 30, 2011 12:43 AM
> Subject: Re: How to get the multiselect select box or checkbox element va=
lues WITHOUT using CGI module
>=20
> From: "Rajeev Prasad"
> Hi,
>=20
> without using CGI.pm how can i collect the values of a multiselect elemen=
t?
>=20
> say for e.g.:
>=20
> < select name=3D"hobbies" id=3D"hobbies" multiple>
>
>
>
>
>
>
> < /select>
>=20
> when the form is submitted, i have to get the selected values in an array=
.. how can i do that?
>=20
>=20
>=20
> *if you are curious, (as per my understanding) even though CGI.pm would m=
ake it easy to get values out of parameters passed to the script by the web=
form. I would still have to do validation of values passed seperately. so =
why should i use a big module just to collect form data? i am using TT to d=
isplay the form/HTML and javascript to validate input.
>=20
> **
> It depends if the form is submitted using GET or POST and it is much hard=
er because you will need to do aditional work to decode the URL-encoded ele=
ments, and you may make errors.
>=20
> If you don't want to use CGI because is too big, you may want to use CGI:=
:Simple.
>=20
> It doesn't matter if you validate the data using JS client side. It shoul=
d be also validated server-side also, but this has nothing to do with the w=
ay you get the data from browser.
>=20
> Octavian
>=20
>=20
> -- To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
> http://learn.perl.org/



--=20
------------------------------------------------------------ -----
Shlomi Fish http://www.shlomifish.org/
My Aphorisms - http://www.shlomifish.org/humour.html

XSLT is the worst thing since nonâ€=90sliced bread.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

am 30.09.2011 13:26:31 von Shawn Wilson

Rajeev Prasad wrote:

>Hi,
> 
>without using CGI.pm how can i collect the values of a multiselect
>element?
> 
>say for e.g.:
> 
>< select name=3D"hobbies" id=3D"hobbies" multiple>
>
>
>
>
>
>
>< /select>
> 
>when the form is submitted, i have to get the selected values in an
>array. how can i do that?
> 

Have your controller parse the post data. See below for my real motivatio=
n for replying.=20

> 
> 
>*if you are curious, (as per my understanding) even though CGI.pm would
>make it easy to get values out of parameters passed to the script by
>the web form. I would still have to do validation of values passed
>seperately. so why should i use a big module just to collect form data?
>i am using TT to display the form/HTML and javascript to validate
>input.


You validate data with js? Are you fucking crazy? So, you think that if I=
want to hand you bad data I'm actually going to use your form to do it?

I'm not (read NOT) saying to remove this. What I'm saying is to use js to=
validate for people (like me) who don't read carefully before they click=
'go' or whatever. You DON'T trust any data at this point. You've got a f=
ew other points to validate that you might be able to trust: reverse prox=
y, db (ie, pg can validate columns), orm resultset / model, or the contro=
ller. Doing validation in some of these places might put load where you d=
on't want it however this can be considered validation. JS validation is =
just a ui thing. You should also write js to sanitize db data when being =
sent to a user. That way, if some xss got through on the up side, they do=
n't get it on the down side. Get it?

Ps, don't put validation (or any other logic in your template). Its a vie=
w - not for logic.=20

Pps, use placeholders or dbic (which does things right for you).

--=20
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

am 30.09.2011 16:19:24 von Rajeev Prasad

--1604915938-2086156069-1317392364=:664
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Mr. Shawn and all others who are etching to criticize ever,  =0Ado you =
guys ever realize that you rarely ever answer the question (maybe you are n=
ot sure), but instead endup criticizing. no code is 'perfect' and people ar=
e here for help.  =0Aif you still want to critic, show a working exampl=
e and maybe then your critic will be welcome.  =0Abrickbats and bouquet=
s are the two faces of same coin, none should affect me - BUT again - reali=
ze that the question went answered.      =0Aby the way, questio=
n was: how do you collect the value of a multiselect, without using CGI mod=
ule.    =0Athx. =0A____________________________ ____=0AFrom: Sh=
awn Wilson =0ATo: "beginners@perl.org" org>=0ASent: Friday, September 30, 2011 6:26 AM=0ASubject: Re: How to get t=
he multiselect select box or checkbox element values WITHOUT using CGI modu=
le Rajeev Prasad wrote: >Hi,=0A>  =
>without using CGI.pm how can i collect the values of a multiselect=0A>elem=
ent?=0A>  >say for e.g.:=0A>  >< select name=3D"hobbies" id=3D"hobb=
ies" multiple>=0A>=0A>=0A>=0A>=0A>=0A>< =
/select>=0A>  >when the form is submitted, i have to get the selected v=
alues in an=0A>array. how can i do that?=0A>  =0AHave your controller p=
arse the post data. See below for my real motivation for replying. >=
  >  >*if you are curious, (as per my understanding) even though CG=
I.pm would=0A>make it easy to get values out of parameters passed to the sc=
ript by=0A>the web form. I would still have to do validation of values pass=
ed=0A>seperately. so why should i use a big module just to collect form dat=
a?=0A>i am using TT to display the form/HTML and javascript to validate=0A>=
input. =0AYou validate data with js? Are you fucking crazy? So, you th=
ink that if I want to hand you bad data I'm actually going to use your form=
to do it? I'm not (read NOT) saying to remove this. What I'm saying i=
s to use js to validate for people (like me) who don't read carefully befor=
e they click 'go' or whatever. You DON'T trust any data at this point. You'=
ve got a few other points to validate that you might be able to trust: reve=
rse proxy, db (ie, pg can validate columns), orm resultset / model, or the =
controller. Doing validation in some of these places might put load where y=
ou don't want it however this can be considered validation. JS validation i=
s just a ui thing. You should also write js to sanitize db data when being =
sent to a user. That way, if some xss got through on the up side, they don'=
t get it on the down side. Get it? Ps, don't put validation (or any ot=
her logic in your template). Its a view - not for logic. Pps, use pla=
ceholders or dbic (which does things right for you). -- =0ATo unsubscr=
ibe, e-mail: beginners-unsubscribe@perl.org=0AFor additional commands, e-ma=
il: beginners-help@perl.org=0Ahttp://learn.perl.org/
--1604915938-2086156069-1317392364=:664--

Re: How to get the multiselect select box or checkbox element valuesWITHOUT using CGI module

am 30.09.2011 16:37:57 von John SJ Anderson

On Fri, Sep 30, 2011 at 10:19, Rajeev Prasad wrote:

> by the way, question was: how do you collect the value of a multiselect, without using CGI module.

Octavian did answer that question; I'll do it again: you collect the
value of a multiselect by getting and parsing the value of the query
string in the HTTP request and/or by getting and parsing the value of
the HTTP request body, depending on whether the HTTP request is a GET
or a POST (and other refinements, like whether you want to support
query string paramaters given in a POST request).

The other thing that people are trying to communicate to you is that
*doing* that, and doing it properly, and doing it properly in all the
odd circumstances that usually don't happen but are allowed by the
HTTP spec, is a HARD problem. In addition to being a HARD problem --
and really, it's the worst kind of hard problem, that kind that's easy
to get *almost* right, so it won't fail until much later under the
absolute worst circumstances -- it's a solved problem. There are
multiple modules on CPAN that do this -- CGI and CGI::Simple have both
been mentioned, IIRC -- so, really, there's no need for you to do
this. One of those will work and it won't be any bigger than something
you write yourself.

Now, after that warning and explanation, if you still want to try --
and hey, some times resolving solved problems is good practice for
figuring out how to solve unsolved problems, right? -- then the first
thing to do would be to get and read the HTTP RFC. (Google will help
with that.) Then, get the source for one of those CPAN modules, and
read it. That will show you a fully working, debugged example of how
to do what you're trying to do, with tests -- so you can modify the
code, try to improve it, and see if it still works in the same way.

And after all that, if you come up with a way to do it better, you'll
be perfectly positioned to contribute it back to the maintainers of
the module, and you'll make *everybody's* life better.

chrs,
john.

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: How to get the multiselect select box or checkbox element valuesWITHOUT using CGI module

am 30.09.2011 19:00:06 von Rob Dixon

On 30/09/2011 12:26, Shawn Wilson wrote:
>
> You validate data with js? Are you f*****g crazy? So, you think that
> if I want to hand you bad data I'm actually going to use your form to do it?

On the contrary, I think you are missing a few brain cells yourself
Shawn. Your friends at work may tolerate such obnoxious and juvenile
language, otherwise they wouldn't be your friends, but the members of
this list have a far higher price to pay to separate themselves from
your froth.

If you cannot find some politeness and mammers in you then I suggest you
withdraw and take your fury out on the cat, or the wife, or whomever
else it is that bears the brunt of your feelings when the rest of the
country is in bed.

Rob

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: How to get the multiselect select box or checkbox element valuesWITHOUT using CGI module

am 30.09.2011 19:33:10 von Rob Dixon

On 30/09/2011 15:37, John SJ Anderson wrote:
> On Fri, Sep 30, 2011 at 10:19, Rajeev Prasad wrote:
>
>> by the way, question was: how do you collect the value of a
>> multiselect, without using CGI module.

> Octavian did answer that question; I'll do it again:

John, whether or not you meant it, you came over to me as criticising
Rajeev for denouncing every reply to his question. But he said he was
talking to:

> Mr. Shawn and all others who are etching to criticize ever,

and his meaning is clear: Shawn's post was splendidly ill-mannered and
overbearing, and his purpose was made dishonourable and buried by his
vulgarity.

Rob

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: How to get the multiselect select box or checkbox element valuesWITHOUT using CGI module

am 30.09.2011 20:04:32 von John SJ Anderson

On Fri, Sep 30, 2011 at 13:33, Rob Dixon wrote:

> John, whether or not you meant it, you came over to me as criticising
> Rajeev for denouncing every reply to his question. But he said he was
> talking to:
>
>> Mr. Shawn and all others who are etching to criticize ever,
>
> and his meaning is clear

To the extent that his reply was possibly more focused than I gave him
credit for, I apologize.

The rest of my reply, however, stands: doing this yourself, unless
it's some sort of learning exercise, is a really bad idea. Further,
had Shawn not already addressed the issue, I would have included
something with the same basic message he delivered (albeit with less
swearing): relying on client-side Javascript code for input validation
is also a Really Bad Idea.

chrs,
john.

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

am 01.10.2011 05:26:30 von Rajeev Prasad

--1091894413-1024565051-1317439590=:13914
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

point of that email was not where validation should happen?? it was s=
ent to find a solution(sample code) to the problem of collecting value of a=
multi..... you missed the point, many people miss the point - it is c=
ommon. Shawn's whole post was on 'where' to validate. Question was: how to =
colle..... =0AAlso to tell someone straightaway : go and read the manu=
al, or RFC or consortium's recommendations is also not a 'brilliant' sugges=
tion, it shows how you do not want to(or can not) respond, but still respon=
ding. I would assume most of the people know about perldoc/manpages/RFCs an=
d white papers. people are looking for sample code, or corrections to their=
'published code'. i was hoping to get some sample code to take cue from.=
after i thought about it a bit more, i liked the suggestion of =
Octavian Rasnita(and also fish), please read his/her response. he understoo=
d the question (and his response was balanced). (again if u r curious more =
info:) I agree .js can be compromised, but this webpage is in trusted envir=
onment with extensive user-activity-logging. =0Athx Bob !! =
________________________________=0AFrom: John SJ Anderson k.org>=0ATo: beginners@perl.org=0ASent: Friday, September 30, 2011 1:04 PM=
=0ASubject: Re: How to get the multiselect select box or checkbox element v=
alues WITHOUT using CGI module On Fri, Sep 30, 2011 at 13:33, Rob Dixo=
n wrote: > John, whether or not you meant it, you =
came over to me as criticising=0A> Rajeev for denouncing every reply to his=
question. But he said he was=0A> talking to:=0A>=0A>> Mr. Shawn and all ot=
hers who are etching to criticize ever,=0A>=0A> and his meaning is clear=0A=
=0ATo the extent that his reply was possibly more focused than I gave him=
=0Acredit for, I apologize. The rest of my reply, however,=A0 stands: =
doing this yourself, unless=0Ait's some sort of learning exercise, is a rea=
lly bad idea. Further,=0Ahad Shawn not already addressed the issue, I would=
have included=0Asomething with the same basic message he delivered (albeit=
with less=0Aswearing): relying on client-side Javascript code for input va=
lidation=0Ais also a Really Bad Idea. chrs,=0Ajohn. -- =0ATo unsu=
bscribe, e-mail: beginners-unsubscribe@perl.org=0AFor additional commands, =
e-mail: beginners-help@perl.org=0Ahttp://learn.perl.org/
--1091894413-1024565051-1317439590=:13914--

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

am 01.10.2011 05:50:41 von merlyn

>>>>> "Rajeev" == Rajeev Prasad writes:

Rajeev> without using CGI.pm

Whenever someone says "without $BEST_WAY_TO_DO_IT", I'm seriously
motivated to say "why not? what is the restriction?".

So, why not?

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095

Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.posterous.com/ for Smalltalk discussion

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: How to get the multiselect select box or checkbox element valuesWITHOUT using CGI module

am 01.10.2011 06:52:52 von Brandon McCaig

Rajeev:

On Fri, Sep 30, 2011 at 11:26 PM, Rajeev Prasad wrote:
> point of that email was not where validation should happen?? it
> was sent to find a solution(sample code) to the problem of
> collecting value of a multi..... > > you missed the point,
> many people miss the point - it is common. Shawn's whole post
> was on 'where' to validate. Question was: how to colle.....
*snip*
> after i thought about it a bit more, i liked the suggestion of
> Octavian Rasnita(and also fish), please read his/her response.
> he understood the question (and his response was balanced).
> (again if u r curious more info:) I agree .js can be
> compromised, but this webpage is in trusted environment with
> extensive user-activity-logging.

I don't think that anybody missed the point. The appropriate
response had already been given: either use an existing module or
explain why you can't (and why you don't go and read about CGI
standards yourself; CGI is not Perl specific).

When I read your post the very first thing that I thought to
respond about was also the JavaScript validation. Everything else
had already been covered and relying on JavaScript validation is
never ok, even if you do have a "trusted environment". Validation
isn't just to defend against attacks from malicious users. It's
also to ensure data integrity and the correct operation of the
application. Just because I'm using a browser that doesn't
support JavaScript doesn't mean that I'm a malicious user.

In short, people were trying to help, and it's not very polite to
tell people that they aren't helping to your satisfaction. Based
on my own personal experience, I imagine that you are trying to
find the "easy button". For whatever reason you don't want to use
existing modules, but you apparently also don't want to go to the
trouble of learning to do it yourself. I'm afraid there rarely is
an easy button. The best help that people can reasonably give you
is to tell you to either use an existing module or RTFM... And I
don't say that to be mean. I know what it's like to just want to
get started being productive and instead be faced with an
overwhelming prerequisist task... It's not fun, but it is
unfortunately the way things go.

Regards,


--
Brandon McCaig
V zrna gur orfg jvgu jung V fnl. Vg qbrfa'g nyjnlf fbhaq gung jnl.
Castopulence Software

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: How to get the multiselect select box or checkbox element valuesWITHOUT using CGI module

am 01.10.2011 06:53:36 von Brandon McCaig

On Fri, Sep 30, 2011 at 11:50 PM, Randal L. Schwartz
wrote:
> Whenever someone says "without $BEST_WAY_TO_DO_IT", I'm seriously
> motivated to say "why not?  what is the restriction?".

Well put, Randal. :D


--=20
Brandon McCaig
V zrna gur orfg jvgu jung V fnl. Vg qbrfa'g nyjnlf fbhaq gung jnl.
Castopulence Software ..org>

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

am 01.10.2011 10:00:47 von Rajeev Prasad

Randal,=0AI thought it would be overkill (RAM, CPU etc.) to use CGI.pm when=
all i need is to get values out of form-variables.=0Abut i am going to set=
tle for CGI::Simple =0A----- Original Message -----=0AFrom: Rand=
al L. Schwartz =0ATo: beginners@perl.org; Rajeev Pra=
sad =0ACc: =0ASent: Friday, September 30, 2011 10:50 PM=
=0ASubject: Re: How to get the multiselect select box or checkbox element v=
alues WITHOUT using CGI module >>>>> "Rajeev" == Rajeev Prasad ..neuli@yahoo.com> writes: Rajeev> without using CGI.pm Whenever s=
omeone says "without $BEST_WAY_TO_DO_IT", I'm seriously=0Amotivated to say =
"why not?=A0 what is the restriction?". So, why not? -- =0ARandal=
L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095=0A rlyn@stonehenge.com> =0ASmalltalk/Pe=
rl/Unix consulting, Technical writing, Comedy, etc. etc.=0ASee http://metho=
dsandmessages.posterous.com/ for Smalltalk discussion -- =0ATo unsubsc=
ribe, e-mail: beginners-unsubscribe@perl.org=0AFor additional commands, e-m=
ail: beginners-help@perl.org=0Ahttp://learn.perl.org/

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: How to get the multiselect select box or checkbox elementvalues WITHOUT using CGI module

am 01.10.2011 11:35:18 von Peter Scott

On Sat, 01 Oct 2011 01:00:47 -0700, Rajeev Prasad wrote:
> I thought it would be overkill (RAM, CPU etc.) to use CGI.pm when all i
> need is to get values out of form-variables. but i am going to settle
> for CGI::Simple

Do you have any figures on how the trivial use of RAM/CPU by CGI.pm=20
impacts your application noticeably? Because programmer time is, in the=20
absence of proof of anything else, the most precious resource, and so=20
anything that takes longer than typing

use CGI;

is overkill. Especially if it requires downloading something not in core=
..

--=20
Peter Scott
http://www.perlmedic.com/ http://www.perldebugged.com/
http://www.informit.com/store/product.aspx?isbn=3D0137001274
http://www.oreillyschool.com/certificates/perl-programming.p hp

--=20
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

am 01.10.2011 14:06:05 von merlyn

>>>>> "Rajeev" == Rajeev Prasad writes:

Rajeev> I thought it would be overkill (RAM, CPU etc.) to use CGI.pm
Rajeev> when all i need is to get values out of form-variables. but i
Rajeev> am going to settle for CGI::Simple

CGI.pm is optimized though with it's own version of the lazy loader.

If you're already forking for CGI, then the trivial time it takes to
load CGI.pm compared to forking shouldn't concern you. If you're
looking for performance, you're already using mod_perl, and therefore
you're loading CGI.pm once for thousands of hits.

Either way, I haven't heard a valid reason from you yet. Just use CGI.pm.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095

Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.posterous.com/ for Smalltalk discussion

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: How to get the multiselect select box or checkbox element valuesWITHOUT using CGI module

am 01.10.2011 22:50:59 von Shawn Wilson

--0015174a064033dad304ae42e6ca
Content-Type: text/plain; charset=ISO-8859-1

On Sep 30, 2011 12:59 PM, "Rob Dixon" wrote:
>
> On 30/09/2011 12:26, Shawn Wilson wrote:
>>
>>
>> You validate data with js? Are you f*****g crazy? So, you think that
>>
>> if I want to hand you bad data I'm actually going to use your form to do
it?
>
>
> On the contrary, I think you are missing a few brain cells yourself
> Shawn. Your friends at work may tolerate such obnoxious and juvenile
> language, otherwise they wouldn't be your friends, but the members of
> this list have a far higher price to pay to separate themselves from
> your froth.
>

Heh, the language actually had exactly the effect I was hoping. Your chances
of remembering this exchange are much higher now than if I would have just
said "please don't do this, its not very wise".

Here's the point - some of you all are accomplished developers and some have
a chance of getting there. You might be involved in a making an awesome
service one day. I might even use a service you design one day. I don't have
the time or energy to audit the public facing code for all the services I
use. I trust that you're smart enough not to do stupid crap (or I don't use
your service).

Since this possibility of me giving you more of my information than I give
most people is real, I felt to compelled to make my point as provocative as
possible (plus it was early and the thought of doing client side validation
really annoyed me).

Also, the completely valid point was made that the validation wouldn't
effect browsers that don't support js. This generally a moot point since 99%
of the rest of a site won't work without js anyway.

Either way, only use client side validation for client things. Don't trust
anything done by or on behalf of the client on the server.

Was that clean enough for you.

Ps, I don't remember reading anywhere that insanities were not allowed?
Iirc, the only mention of language was that this list is an English speaking
list.

--0015174a064033dad304ae42e6ca--

Re: How to get the multiselect select box or checkbox element valuesWITHOUT using CGI module

am 01.10.2011 23:56:36 von Brandon McCaig

Shawn:

On Sat, Oct 1, 2011 at 4:50 PM, shawn wilson wrote:
> Also, the completely valid point was made that the validation
> wouldn't effect browsers that don't support js. This generally
> a moot point since 99% of the rest of a site won't work without
> js anyway.

That is only true of poorly coded Web sites. :) Which admittedly
is most Web sites, but I digress. I use Firefox's NoScript
extension, blocking EVERY domain by default. When I arrive at a
site that doesn't work like this then it had better have a good
reason for me to care or I'm leaving. It's also not uncommon for
me to browse the Web from a JavaScript-less text-based browser
(links-family, for example). Preventing me from finding the
information that I need is just silly. It's easier to make the
site work for me than it is to make the site fancy and Web 2.0
ish for people that also don't care and just want the damn
information. xD

JavaScript should be used to enhance the user experience, not
define it. Client-side validation is just part of that. It saves
the user a senseless request/response period and page
re-rendering. I personally believe that you should develop a
JavaScript-less site first. Then and only then should you develop
JavaScript to enhance the experience for supported users, if your
time and budget support this. You should have well defined goals
though. Just because you've added JavaScript doesn't mean you've
made the user experience better. Most sites today make the user
experience worse with JavaScript (which is why NoScript exists).

Regards,


--
Brandon McCaig
V zrna gur orfg jvgu jung V fnl. Vg qbrfa'g nyjnlf fbhaq gung jnl.
Castopulence Software

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: How to get the multiselect select box or checkbox element valuesWITHOUT using CGI module

am 02.10.2011 02:39:58 von Rob Dixon

On 01/10/2011 21:50, shawn wilson wrote:
> On Sep 30, 2011 12:59 PM, "Rob Dixon" wrote:
>>
>> On the contrary, I think you are missing a few brain cells yourself
>> Shawn. Your friends at work may tolerate such obnoxious and juvenile
>> language, otherwise they wouldn't be your friends, but the members of
>> this list have a far higher price to pay to separate themselves from
>> your froth.
>>
>
> Heh, the language actually had exactly the effect I was hoping. Your chances
> of remembering this exchange are much higher now than if I would have just
> said "please don't do this, its not very wise".

Not at all. You have made 'this exchange' about your use of abusive
language, and I would have to look back to see what point you were
making. Given your abusive manner I doubt if it was well-explained or
significant.

Rob

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

am 03.10.2011 01:53:02 von Rajeev Prasad

can not say no to you. i am using CGI::Simple now. i will be movi=
ng over to mod_perl later. ----- Original Message -----=0AFrom: =
Randal L. Schwartz =0ATo: Rajeev Prasad hoo.com>=0ACc: "beginners@perl.org" =0ASent: Saturday, =
October 1, 2011 7:06 AM=0ASubject: Re: How to get the multiselect select bo=
x or checkbox element values WITHOUT using CGI module >>>>> "Rajeev" =
== Rajeev Prasad writes: Rajeev> I thought it=
would be overkill (RAM, CPU etc.) to use CGI.pm=0ARajeev> when all i need =
is to get values out of form-variables.=A0 but i=0ARajeev> am going to sett=
le for CGI::Simple CGI.pm is optimized though with it's own version of=
the lazy loader. If you're already forking for CGI, then the trivial =
time it takes to=0Aload CGI.pm compared to forking shouldn't concern you.=
=A0 If you're=0Alooking for performance, you're already using mod_perl, and=
therefore=0Ayou're loading CGI.pm once for thousands of hits. Either =
way, I haven't heard a valid reason from you yet.=A0 Just use CGI.pm. =
-- =0ARandal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 77=
7 0095=0A =0A=
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.=0ASee =
http://methodsandmessages.posterous.com/ for Smalltalk discussion=0A

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/