37,743
社区成员




#!/bin/perl
package test;
use Data::Dumper;
my @all;
sub new()
{
my $ref = shift;
$class = ref $ref || $ref;
my $self = {};
bless $self, $class;
}
sub test()
{
my $self = shift;
my $data = shift;
push @all, $data;
print "all_data is ", (join '#', @all), "\n";
}
1;
#!/usr/bin/perl
use strict;
use warnings;
use test;
use Data::Dumper;
print "new a\n";
my $a = test->new();
$a->test("abc");
print "new b\n";
my $b = test->new();
$b->test("123");