--- EriK W <[EMAIL PROTECTED]> wrote:
> Thanks! Paul, you are really good tutor, It is much clear for me now,

Thank you. That's a high compliment.

> But I think I still can't easily distinguish the list and scalar
> context.

That's a common problem.
To oversimplify, a scalar context is a situation where an expression is
expected to return just one thing, like

  my $var = func();

This calls func() in a scalar context.
Suppose func was

  sub func {
      my @ray = 0..9;
  }

$var would be 10, because the return from func() would be the value of
the array assignment; an array in a scalar context returns the number
of elements. (Again, list, please correct me if I fumble this.)

On the other hand, using the same function,

 my @lst = func();

would assign the numbers zero to nine to @lst, because it's a list
context -- a situation in which more than one thing is expected.

Better? =o)

> Like here,  you say it is a list context,  just because we are using
> the "sort" or because the (....)[0] ?
> 
> 
> 
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

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

Reply via email to