2015年4月21日星期二

Perl : subroutine signatures 跟 prototypes

http://www.effectiveperlprogramming.com/2015/04/use-v5-20-subroutine-signatures/

http://modernperlbooks.com/mt/2009/08/the-problem-with-prototypes.html

http://docstore.mik.ua/orelly/perl4/prog/ch06_04.htm

http://stackoverflow.com/questions/297034/why-are-perl-5s-function-prototypes-bad





subroutine signatures 跟其他函数没太大差别,就是函数变量声明一下,不合适的warning一下

prototype 则提供接近内置函数的功能,使用时不用带括号、自动识别上下文,例如

sub mypop (\@) 

mypop @array

没有评论:

发表评论