On 11/16/09 Mon  Nov 16, 2009  1:23 PM, "Jackie Jackie"
<j_jacki...@yahoo.ca> scribbled:


> What this means 
> 
> if( ! length() )

It means evaluate the expression '! length()' in a scalar context, interpret
the value as a logical expression, and branch accordingly.

! is the not operator.

length() is the length operator applied to the default variable $_ and
returning some non-negative integer (0 or more). A zero value will be
considered false, and any value greater than zero will be considered true.

The ! operator reverses these values.

Thus, if the variable $_ contains a blank string, the statements after the
if() statement will be executed. If $_ contains any characters, the
statements will be skipped down to the first else or elsif statement.



-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to