文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>perl闭包

perl闭包

时间:2010-09-29  来源:lyb137

The kind of subroutine that can access all lexical variables that existed at the time we declared it is called a closure (a term borrowed from the world of mathematics). In Perl terms, a closure is just a subroutine that references a lexical variable that has gone out of scope. 闭包就是能引用在程序范围外的词法变量的子程序。 例:$count #!/usr/bin/perl -w
use strict;
{
my $count = 10;
sub count_one{$count--};
sub count_two{$count};
}
count_one();
print 'we have seen', count_two() ,"counts!\n"
 
相关阅读 更多 +
排行榜 更多 +
毒药轮盘手机版下载

毒药轮盘手机版下载

休闲益智 下载
剑侠情缘零b服手游下载

剑侠情缘零b服手游下载

角色扮演 下载
惊魂动物园游戏手机版下载

惊魂动物园游戏手机版下载

冒险解谜 下载