On Fri, 5 Jan 2001, Lawrence, Rob wrote:
> This is sad
>
> How do you check to see if a string is empty?
>
> my $stuff
> while($stuff "I don't know)
> {
> print "You must enter a value\n";
> $stuff = ;
> }
>
You can check to see if it is equal to an empty string, e.g.
if ($stuff eq '') {
Brian Steele wrote:
>
> I'm I missing something here?
>
> What about
>
> if(!$stuff) {print "string is empty"}
What about:
my $stuff = 0;
--
Best Regards,
mds
mds resource
888.250.3987
"Dare to fix things before they break . . . "
"Our capacity for understanding is inversely p
r more Any characters? sort of like
> #using $_
> unless /.+/ {print "nothing here\n"}
>
> regards,
> bill naftel
>
>
> -Original Message-----
> From: "Lawrence; Rob"
> Sent: Fri 1/5/2001 7:47 PM
> To: "'[EMAIL PROTECTED]'"
>
gards,
bill naftel
-Original Message-
From: "Lawrence; Rob"
Sent: Fri 1/5/2001 7:47 PM
To: "'[EMAIL PROTECTED]'"
Cc:
Subject: Dumb Question: How to check if a string is empty
Th
"Lawrence, Rob" wrote:
>
> This is sad
>
> How do you check to see if a string is empty?
>
> my $stuff
> while($stuff "I don't know)
> {
> print "You must enter a value\n";
> $stuff = ;
> }
There's defined and there's empty. You can check for either or both.
my $stuff;
if ($stuff) {
This is sad
How do you check to see if a string is empty?
my $stuff
while($stuff "I don't know)
{
print "You must enter a value\n";
$stuff = ;
}
Any help is appreciated
Rob
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.A