Error de sintaxis de Perl - elseif debería ser elsif en

Any ideas of what I need to change in this Perl code?

perl -wc yields:

elseif should be elsif at cgitelnet-mod.pl line 410.
syntax error at cgitelnet-mod.pl line 411, near ")
    {"
syntax error at cgitelnet-mod.pl line 444, near "else"
syntax error at cgitelnet-mod.pl line 453, near "}"
Illegal declaration of subroutine main::PrintDownloadLinkPage at cgitelnet-mod.pl line 461.

Whole file can be found here: http://pastebin.com/7r5pfW5y

¡Cualquier ayuda es muy apreciada!

preguntado el 27 de agosto de 11 a las 21:08

It says "elseif" should be elsif". One idea would be to change where you've said "elseif" to say "elsif" instead. -

That would be one idea yes... can I delete questions as if they never existed... :) thanks for the answer. -

I don't think you need to delete it. We all make simple mistakes from time to time, don't beat yourself up about it. Next time, you will know how to interpret this error. -

2 Respuestas

Te equivocaste elsif. No lo es else-if, remove the extra e y deberías estar bien.

Respondido 28 ago 11, 01:08

If this answer answers your question, you should mark it with the checkmark to the left. - TLP

You need to remove the second e in elseif....Unlike many languages Perl spells it as elsif

Respondido 28 ago 11, 01:08

Many? The if statement of C, C++, Java and JavaScript don't have such a clause. VisualBasic and Python use elseif. Perl and Ruby use elsif. Python, sh y bash utilizado elif. - Ikegami

Yes "many" - you just listed two languages that spell it as elsif and "many" others that do not. By the way C, C++, Java, and JavaScript all have an "else if" clause...not to mention my answer did not state how the proper syntax is in other languages, merely how the syntax is no (and as you pointed out most do not use "elsif"). - Exupery

Usted puede tener significó to say that there is no standard way of spelling elseif, but what you said has drastically different implications. It does not simply mean what you said it does. I believe that is now clarified by the comment I posted, though, so all's good. - Ikegami

No, C, C++, Java, and JavaScript don't have an "else if" clause. That if is start of a statement that has nothing to do with the else. If it does have an else if clause, then it also has an else for cláusulaif (x) y(); else for (...) { ... }) y un else z() cláusulaif (x) y(); else z();). - Ikegami

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.