Very EASY question

I want to test a variable if it has got characters in it. Somehow this doesn't work. Can someone provide me with the correct code ?

if $form{$key}='' {
 print "allright";

  }
oostwijkAsked:
Who is Participating?
 
maneshrConnect With a Mentor Commented:
try this....

if ($form{$key}){ ## Key DOES have a value in it!!
  print "All right\n";
}else{
   print "Empty :-( \n";
}
0
 
oostwijkAuthor Commented:
I ment to say:

if $form{$key}="" {
 print "allright";
  }
0
 
oostwijkAuthor Commented:
Ok, that works fine...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.