How does one generate and track a bunch of objects? I'm thinking something like this?
Thanks
BROKEN CODE:
#!/usr/bin/perl use strict; use warnings; use Dog; my @pack = (); create_dog(15); foreach(@pack) { $_->bark; } sub create_dog { for (my $i=0; $i != $_[0]; $i++) { my $x = Test->new(); my $dog = \$x; push @pack, $dog; } }
In reply to Tracking objects. by yoda54
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |