use strict; use warnings; for my $name (qw(Title Description Object Properties Value Wibble)) { my $code = main->can("do$name"); if (!$code) { print "!!! Missing handler for '$name'\n"; next; } $code->(); } sub doTitle { print "Title handler\n" } sub doDescription { print "Description handler\n" } sub doObject { print "Object handler\n" } sub doProperties { print "Properties handler\n" } sub doValue { print "Value handler\n" }