[Moscow.pm] refactoring

Oleg Alexeenkov proler на gmail.com
Пт Окт 16 06:57:23 PDT 2015


Илья Винокуров <ilvin на mail.ru> писал(а) в своём письме Thu, 15 Oct 2015  
09:55:18 +0300:

> Как-то так...

> my ($father, $mother, $email, $homepage, $date_of_birth) = (
>   $person->get_father // undef,
>   $person->get_mother // undef,
>   $person->get_email // undef,
>   $person->get_homepage // undef,
>   $person->get_date_of_birth // undef
> );

$person->get_father // undef
Такое выражение вообще имеет смысл?
оставить просто
$person->get_father


> push @person_row,
>     $father && $father->get_id,
>     $mother && $mother->get_id,
>     $email,
>     $homepage,
>     $date_of_birth ? join('/', $date_of_birth->day // '',  
> $date_of_birth->month // '', $date_of_birth->year // '') : '';

no warnings qw(uninitialized);
и не надо этих // ''


Подробная информация о списке рассылки Moscow-pm