in reply to Re^4: CGI::Ajax No head/html tags, nowhere to insert. Returning javascript anyway.
in thread CGI::Ajax No head/html tags, nowhere to insert. Returning javascript anyway.
Sure, but you can't invent your own syntax, you have to use perl's.
In perl, commas are not comma-colons I mean colon-commas semicolons . You can't just plop an if(){}statement into the middle of an expression (What is the difference between a Statement and an Expression?). if is a control structure (a block) , it controls the flow of the program (branch/decision).
But, you can do what you were thinking of with a do-block, or switch to the Conditional Operator (mini-if, ternary, trinary, terrychilds)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: CGI::Ajax No head/html tags, nowhere to insert. Returning javascript anyway. (mini-if ternary)
by Anonymous Monk on Sep 01, 2013 at 19:17 UTC |
In Section
Seekers of Perl Wisdom