Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: true/false condition - what am I doing wrong?

by Taulmarill (Deacon)
on Dec 08, 2011 at 14:23 UTC ( #942441=note: print w/ replies, xml ) Need Help??


in reply to true/false condition - what am I doing wrong?

The correct way to use the teary operator would be like this:
$redo = $type eq "add" ? "wiki_add2" : "wiki_edit2";
I would like to tell you what exactly happens, when perl executes your version. But to be honest i can't quite figure it out.


Comment on Re: true/false condition - what am I doing wrong?
Download Code
Re^2: true/false condition - what am I doing wrong?
by sumeetgrover (Scribe) on Dec 08, 2011 at 14:44 UTC

    Exactly! Taulmarill has pointed it out right. You are using a compound if statement without the appropriate syntax. Also, I notice in your code that you've declared the variables $type and $redo twice within the same lexical scope! You might like to change this.

Re^2: true/false condition - what am I doing wrong?
by ultranerds (Friar) on Dec 08, 2011 at 15:21 UTC
    Thanks guys - duh I should have seen that one. Joys of trying to work when you have a stinking headache and cold

    Thanks!

    Andy

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://942441]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (9)
As of 2015-07-03 13:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (53 votes), past polls