Re: Saying an item is empty

2004-01-20 Thread Jenda Krynicky
From: "Trina Espinoza" <[EMAIL PROTECTED]> > I would like to know how I would say if $item equals $tempitem OR if > $item is empty(the variable is a placeholder that has nothing in it), > execute command. I'd revert the tests. First see whether it's empty, then whether it equals something:

Re: Saying an item is empty

2004-01-19 Thread Dan Anderson
scalar (@array) can be used to find the number of elements in @array. @{$foo} can be used to work with the array represented by the array reference $foo you can combine the two for scalar(@{$foo}) Also remember hashes are even sized arrays. -Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: Saying an item is empty

2004-01-19 Thread John W. Krahn
Trina Espinoza wrote: > > I would like to know how I would say if $item equals $tempitem OR if $item is > empty(the variable is a placeholder that has nothing in it), execute command. By empty do you mean the null string "": if ( $item eq $tempitem or $item eq '' ) { Or do you mean the value

Re: Saying an item is empty

2004-01-19 Thread Steve Grazzini
Trina Espinoza wrote: I would like to know how I would say if $item equals $tempitem OR if $item is empty(the variable is a placeholder that has nothing in it), execute command. Usually "empty" means "undefined", and if that's what you mean, you could check like this: if ((not defined $item)

Saying an item is empty

2004-01-19 Thread Trina Espinoza
I would like to know how I would say if $item equals $tempitem OR if $item is empty(the variable is a placeholder that has nothing in it), execute command. Are either of these saying the above statement because I don't seem to be getting the expected results. If ($item =~ /^(\D+)(\d+)/ {)