Perl OOP

1. 模塊/類(包) 建立一個名爲Apple.pm的包文件(擴展名pm是包的缺省擴展名。意爲Perl Module)。 一個模塊就是一個類(包)。php 2. new方法 new()方法是建立對象時必須被調用的,它是對象的構造函數。html sub new { my $class = shift; my $this = {}; bless $this, $class;
相關文章
相關標籤/搜索