Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check entry if it empty

Status
Not open for further replies.

csudess

Technical User
Apr 1, 2010
14
HU
How could i check the entry when is empty or not?
 
perl entry?!:D
this is a sample entry code so this is the entry

$ent=$mw->Entry(-width=>4,
-font=>"arial 10 bold"
);
 
Something like this:

&checkempty($username,"Your name cannot be blank.");

Newposter
"Good judgment comes from experience. Experience comes from bad judgment."
 
Would you mean:

Code:
$ent=$mw->Entry(-width=>4,                
                -font=>"arial 10 bold"
               );
if ($ent) {
     #not empty
}
else {
     #empty
}

Chris
 
Thank u for ur answers i found the right code which is:

use strict;
use warnings;
use 5.010;

my $entry = '';

if ($entry eq '') {
say '$entry is blank';
}
else {
say '$entry might be undef';
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top