my $tname = $properties->{'Name'} my %attributes = %{$properties->{'Attributes'}}; my %stix; my %cybox = ( Title => sub { ... }, Description => sub { ... }, Object => sub { ... }, Properties => sub { ... }, _DEFAULT_ => sub { ... }, ); my %URIObj; if ($tname =~ /^stix:(\w+)/) { my $component = $1; ... } elsif ($tname =~ /^cybox:(\w+)/) { my $component = $1; $component = '_DEFAULT_' unless exists $cybox{$component}; $cybox{$component}->(); } elsif ($tname =~ /^URIObj:(\w+)/) { my $component = $1; ... }