my %commands; foreach my $method ($class->get_all_method_names) { next unless $method =~ /^cmd_/; $method =~ s/^cmd_//; $commands{$method}=1; }