Solved

Very EASY question

Posted on 2000-03-21
3
128 Views
Last Modified: 2013-12-25
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";

  }
0
Comment
Question by:oostwijk
  • 2
3 Comments
 

Author Comment

by:oostwijk
ID: 2642244
I ment to say:

if $form{$key}="" {
 print "allright";
  }
0
 
LVL 16

Accepted Solution

by:
maneshr earned 25 total points
ID: 2642273
try this....

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

Author Comment

by:oostwijk
ID: 2651343
Ok, that works fine...
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now