Update: Since ZZamboni is cloning a different style that I am (Yet another sinister Perl Hacker)... I want to be more clear:
my $self =<<__END_OF_EVIL_GUY__ Sinister, dominating, loud, deep laughing tall guy with many weapons to hurt you with. __END_OF_EVIL_GUY__
and the rest as it was...
my $clone = ref $self; # want to build an army in minutes? my $army = []; while ( my $clone = ref $self ) { push @{$army}, $clone; } # this has chiling implications... -- Casey

Replies are listed 'Best First'.
RE: cloning
by ZZamboni (Curate) on Jul 03, 2000 at 23:22 UTC
    Hm... This doesn't sound right. You are creating copies of the name of the class, but not clones of the object itself. Maybe something like this:
    while(my $clone = (ref $self)->new) { push @{$army}, $clone; }
    Now you have a real army, and not only a list of soldiers' names... :-)

    --ZZamboni

      Or, if you're an illusionist, you could cast Mirror Image.

      while(my $clone = \$self) { push @{$army}, $clone; }

      Much less resource-intensive. Of course, it's all a moot point since you spend all your time creating an army and never attack or defend anything.

      *Woof*