在閱讀下載的Perl模塊時,我發現了幾種定義輸入參數的方法,如下所示。他們之間有什麼不同?Perl中參數輸入機制有什麼區別?
sub new{
my $class = shift;
my $self = {@_};
bless{$self, $class};
}
sub count1{
my ($self, $lab1) = @_;
}
sub new1{
my ($class, $lab1) = @_;
my $self = {};
bless $class, $self;
}
sub setpath{
my $self = shift;
}