Perl
Tim_Ryan
这个作者很懒,什么都没留下…
展开
-
Perl中的state
state $number; #声明了一个持久性私有变量$number.持久性私有变量其实就是其他语言中所谓的静态变量(static).不过在Perl中想要使用state,必须在文件开头加上 use feature qw(state); 或者 use 5.010; 因为state功能是在5.010版本中才开始提供的。原创 2012-11-27 14:40:09 · 1727 阅读 · 0 评论 -
学习Perl中的哈希时遇到的小问题
my %hash = { "a" = 1, "b" = 2, "c" = 3 };while ( ($key,$value)= each %hash ){print "$key => $value";}竟然输出了 HASH(0x2dce58) =>这是什么东东,看着像地址,看了半天也没发现这么简单的哈希哪里有问题,于是上网查了一下,发现哈希赋值时得使用()而不是{原创 2012-12-05 22:47:22 · 571 阅读 · 0 评论