on Tue, 27 Aug 2002 21:17:34 GMT, [EMAIL PROTECTED] (Eddie C.)
wrote: 

> # First program
> [...]
> (my $word) = ($line =~ /(\S+)/);

The parentheses force the rhs to be evaluated in list context. In list 
context, the /(\S+)/ construct returns al list of the match(es).

> # Second program
> [...]
> my $word = ($line =~ /(\S+)/);

No parentheses, therefor rhs evaluated in scalar context, in which case 
it returns the number of successful matches.

-- 
felix

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to