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:
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
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
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)
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+)/ {)