Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: single line if conditional

by tcf22 (Priest)
on Mar 31, 2004 at 15:55 UTC ( #341325=note: print w/ replies, xml ) Need Help??


in reply to single line if conditional

Works like the code says it should. I think you may want to set $hash{name} = "this and that" if $name is empty. I could be wrong. Right now you are doing the reverse. If it has something in it then you do the assignment.

I have a hunch this is what you meant:

$name = param('name'); $hash{name} = 'this and that' if $name eq '';
What do you want this piece of code to do? What happens when you run it?

- Tom


Comment on Re: single line if conditional
Select or Download Code
Re: Re: single line if conditional
by Anonymous Monk on Mar 31, 2004 at 16:30 UTC
    I made another post near the top if you want to see my sample code. I have HTML checkboxes and I want to say something like:: if this checkbox exists (has been checked), save this ($name in this example) into our hash. We are checking our variable against "" to see if it was checked. Maybe this is the problem? Do checkboxes produce something that would NOT eq ""?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (14)
As of 2014-07-31 20:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (252 votes), past polls