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"; } }