[Moscow.pm] тест на понимание Perl
Андрей А
asan999 на gmail.com
Вт Янв 31 12:48:56 PST 2012
Ды вы прикалываетесь наверно!
http://perldoc.perl.org/perldata.html#List-value-constructors
годный троллинг!
01.02.2012 0:27, Maxim Vuets пишет:
> Мне кажется, это не поведение списка, а оператор запятая:
>
> "Binary "," is the comma operator. In scalar context it evaluates its
> left argument, throws that value away, then evaluates its right
> argument and returns that value. This is just like C's comma operator.
> In list context, it's just the list argument separator, and inserts
> both its arguments into the list. These arguments are also evaluated
> from left to right."
> --- http://perldoc.perl.org/perlop.html#Comma-Operator
>
> Т.е.:
>
> ($s) = (2, 8, 37); # список
> $s = (2, 8, 37); # запятая
>
> Поправьте, если ошибаюсь.
>
Подробная информация о списке рассылки Moscow-pm