in reply to Re: What is the best way to determine if a string is blank?
in thread What is the best way to determine if a string is blank?
my $var1; my $var2 = undef; my $var3 = ""; my $var4 = 0; my $var5 = 1; my $var6 = "foo"; for ($var1,$var2,$var3,$var4,$var5,$var6) { print defined($_)?1:0 . "\t" . ($_)?1:0 . "\n"; } __END__ Output: 0 0 0 0 1 0 1 0 1 1 1 1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: What is the best way to determine if a string is blank?
by EvanK (Chaplain) on Jan 05, 2001 at 00:08 UTC |