Главная страница


ru.perl

 
 - RU.PERL ----------------------------------------------------------------------
 From : Nick Kostirya                        2:5020/400     11 Feb 2004  11:01:54
 To : Yury Kopyl
 Subject : Re: C-style Logical Defined-Or
 -------------------------------------------------------------------------------- 
 
 >
 >  NK>>> Привет.
 >  NK>>> А что "C-style Logical Defined-Or" убрали?
 >
 >  NK>>> В http://search.cpan.org/~nwclark/perl-5.8.3/pod/perlop.pod не
 >  NK>>> могу найти.
 >
 >
 >  NK> http://search.cpan.org/~nwclark/perl-5.8.3/pod/perlop.pod#C-style_
 >  NK> Logical_Or
 >
 >  NK> Что то не вижу там оператора //
 >
 >
 
 http://search.cpan.org/~nwclark/perl-5.8.3/pod/perlop.pod#Assignment_Operato
 
 > rs
 
 Hашел!
 Это в http://search.cpan.org/src/HVDS/perl-5.9.0/pod/perlop.pod
 
 Вот цитата
 =head2 C-style Logical Defined-Or
 
 Although it has no direct equivalent in C, Perl's C<//> operator is related
 to its C-style or.  In fact, it's exactly the same as C<||>, except that it
 tests the left hand side's definedness instead of its truth.  Thus, C<$a //
 
 $b>
 
 is similar to C<defined($a) || $b> (except that it returns the value of
 C<$a>
 rather than the value of C<defined($a)>) and is exactly equivalent to
 C<defined($a) ? $a : $b>.  This is very useful for providing default values
 for variables.  If you actually want to test if at least one of C<$a> and
 C<$b> is defined, use C<defined($a // $b)>.
 --- ifmail v.2.15dev5.3
  * Origin: Demos online service (2:5020/400)
 
 

Вернуться к списку тем, сортированных по: возрастание даты  уменьшение даты  тема  автор 

 Тема:    Автор:    Дата:  
 C-style Logical Defined-Or   Nick Kostirya   10 Feb 2004 14:03:35 
 Re: C-style Logical Defined-Or   Yury Kopyl   10 Feb 2004 17:21:57 
 Re: C-style Logical Defined-Or   Nick Kostirya   10 Feb 2004 18:54:24 
 Re: C-style Logical Defined-Or   Yury Kopyl   10 Feb 2004 20:22:13 
 Re: C-style Logical Defined-Or   Nick Kostirya   11 Feb 2004 11:01:54 
Архивное /ru.perl/6577bfe4b6f4.html, оценка 1 из 5, голосов 10
Яндекс.Метрика
Valid HTML 4.01 Transitional