type 01_fact.pl
use 5.16.0;
# use feature 'say';
my $fact;
$fact=sub{
my ($x)=@_;#
return $x if $x==1;
return $x*$fact->($x-1);
}
say $fact->(5);
perl -c 01_fact.pl
syntax error at 01_fact.pl line 9, near "say"
01_fact.pl had compilation errors.
perl -v
This is perl 5, version 16, subversion 0 (v5.16.0) built for
MSWin32-x64-multi-thread
что я делаю не так?
14.09.2012, 15:22, "Анатолий Шарифулин" <[email protected]>:
> Пример рабочий, какая ошибка или say забыл написать? :-)
>
> 2012/9/14 Nikolay Mishin <[email protected]>
>> my $fact;$fact=sub{
>> my ($x)=@_;#
>> return $x if $x==1;
>> return $x*$fact->($x-1);
>> }
>
> --
> С уважением,
> Анатолий Шарифулин.
> ,
> --
> Moscow.pm mailing list
> [email protected] | http://moscow.pm.org
--
Nikolay Mishin
--
Moscow.pm mailing list
[email protected] | http://moscow.pm.org