[22567] in Perl-Users-Digest
Perl-Users Digest, Issue: 4788 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Mar 30 21:06:37 2003
Date: Sun, 30 Mar 2003 18:05:08 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sun, 30 Mar 2003 Volume: 10 Number: 4788
Today's topics:
Re: And... <tore@aursand.no>
Re: CGI syntax error? What syntax error? <nobody@dev.null>
Re: CGI syntax error? What syntax error? <tassilo.parseval@rwth-aachen.de>
CGI.pm checkbox: bizarre stickiness problem <"ns_news [at] netspinner [point] co [point] uk">
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 31 Mar 2003 00:24:41 +0200
From: "Tore Aursand" <tore@aursand.no>
Subject: Re: And...
Message-Id: <pan.2003.03.30.14.47.20.409032@aursand.no>
On Sun, 30 Mar 2003 07:19:45 -0600, Ami wrote:
> Ja. Ich bin Japane.
Listen; Haven't you seen _more than_ 99% of the messages in this
newsgroup is written in English?
You are _really_ annoying me (and others) with your top-posting,
multi-langauge postings etc. etc. In turn, that means that you're now in
my killfile.
*plonk*
--
Tore Aursand
------------------------------
Date: Sun, 30 Mar 2003 19:55:23 GMT
From: Andras Malatinszky <nobody@dev.null>
Subject: Re: CGI syntax error? What syntax error?
Message-Id: <3E874B2B.4060507@dev.null>
Caie wrote:
> Hey wizards!
Can a muggle answer too?
> I'm doing my nut in over this one. Can you help? Sorry this is quite
> a large chunk.
OK, let's drop some nonessetial lines here:
[snip]
> if ($email_address ne $blank_string){
[snip]
> }
[snip]
> else{
[snip]
> } # end else email address invalid
[snip]
> elsif ($email_address eq $blank_string){
[snip]
> } # end else no email address
> } # end if
> The errors being spat out are the last 12 lines of this code. The
> script returns the following two error messages
>
> syntax error at apd.cgi line 145, near "elsif"
> syntax error at apd.cgi line 155, near "}"
> Execution of apd.cgi aborted due to compilation errors.
>
> There are no leading or trailing spaces around END_HTML and I cannae
> see any typos. Put me out of my misery, if you can.
>
> Caie
>
Perl's syntax for this type of conditional is
if (CONDITION) {
#Do stuff
} elsif (ANOTHER CONDITION) {
#Do something else
} elsif (YET ANOTHER CONDITION) {
#Think of something more to do.
#You can have dozens of these elsifs if that's what you fancy.
} else {
#If all else fails, do this
};
This is the absolute end of the statement. The else part has taken care
of any contingencies not already taken care of. It makes no sense,
indeed, it's a syntax error, to follow the else block with another elsif
as you are doing.
------------------------------
Date: 30 Mar 2003 19:56:39 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: CGI syntax error? What syntax error?
Message-Id: <b67i5n$mhj$1@nets3.rz.RWTH-Aachen.DE>
Also sprach Chris W:
> "Tassilo v. Parseval" wrote in message
>> Perl does not know about 'elsif'. It should be 'else if' instead.
>> Perhaps a small recapulation of 'perldoc perlsyn' wouldn't hurt.
>
> That's just not true. Perl knows elsif, and it works fine, if you code it
> right. The problem is he has an 'else' before the 'elsif', and that's not
> legal.
Yes, which is why I cancelled my article shortly afterwards (I abused
vim's syntax-highlighter to check for elsif). Within the past months I
was very busy with C and less busy with Perl. This probably caused the
confusion.
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
------------------------------
Date: Sun, 30 Mar 2003 21:01:55 +0000
From: "ns_news [at] netspinner [point] co [point] uk" <"ns_news [at] netspinner [point] co [point] uk">
Subject: CGI.pm checkbox: bizarre stickiness problem
Message-Id: <3e8759b6$0$25665$fa0fcedb@lovejoy.zen.co.uk>
I've run into what looks like either a fundamental bug with
sticky checkboxes in CGI.pm v2.91 (and earlier), or a major
code screw-up on my part.
If I create a checkbox like:
my $cb1 = checkbox
(
-name => 'override_is_0',
-value => '1',
-checked => '1',
-override => 0,
);
or:
my $cb2 = checkbox
(
-name => 'no_override',
-value => '1',
-checked => '1',
);
I can't turn it off subsequently. It looks like override is
switched on regardless of the arguments passed to sub checkbox.
You can see this code in action (and the code itself) at:
http://www.netspinner.co.uk/cgi-bin/WebUtilities/cgi-bin/cb_problem.pl
Now, I'm pretty baffled as a) I can't see any obvious coding error
and b) I don't recall running into this problem before, and I've
used checkbox plenty of times.
Anyone have any idea what's going on ?
Steve Collyer
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 4788
***************************************