Thread Array als Objektvariable (6 answers)
Opened by Robse at 2005-08-29 19:13

sri
 2005-08-30 16:14
#57509 #57509
User since
2004-01-29
828 Artikel
BenutzerIn
[Homepage] [default_avatar]
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
my $a = MyArray->new;

$a->testfunc('foo');
$a->testfunc('bar');
$a->testfunc('baz');

print "$_\n" for $a->list;

package MyArray;

sub new { bless [], shift }

sub testfunc { push @{ $_[0] }, $_[1] }

sub list { @{ $_[0] } }

1;

View full thread Array als Objektvariable