note
munchie
I think that I could change
<code>
sub set_power {
my $self=shift;
my $power=shift;
push @{$self->{POWERS}}, $power;
}
sub get_powers {
my $self=shift;
my $num=1;
foreach my $power ( @{$self->{POWERS}} ) {
print "$num => $power\n";
$num++;
}
print "\n";
}
</code>
into something like:
<code>
sub power {
my $self=shift;
if ($_[0]) {
my $power=shift;
push @{$self->{POWERS}}, $power;
} else {
my $self=shift;
my $num=1;
foreach my $power ( @{$self->{POWERS}} ) {
print "$num => $power\n";
$num++;
}
print "\n";
}
}
</code>
It would be called as <code>$obj->power("Power name")</code> to set, and <code>$obj->power()</code> to view.
<p>> munchie, the number munchin newb<br>
<font color=blue>Llama: The other other white meat!</font><br>
<font size=-1>(you had to be there :-P)</font>
152358
153177