in reply to Calling a subroutine when part of call is a variable Contant

In short, I think this may be all you need:

$self->xml()->$_() for values %{STUFF()};

You didn't describe the relationship between the various values and functions; what packages are in use; or what the functions do internally. I've made some (fairly gross) guesses for the test code below; hopefully, you can adapt this for your specific requirements.

#!/usr/bin/env perl -l use strict; use warnings; package With::Xml; sub new { bless {} => 'With::Xml' } sub xml { print "With::Xml::xml(): @_"; $_[0] } sub first_name { print "With::Xml::first_name(): @_" } sub last_name { print "With::Xml::last_name(): @_" } package main; use constant STUFF => { name1 => 'first_name', name2 => 'last_name', }; my $self = With::Xml::->new(); $self->xml()->$_() for values %{STUFF()};

Output:

With::Xml::xml(): With::Xml=HASH(0x7f9b998040b0) With::Xml::first_name(): With::Xml=HASH(0x7f9b998040b0) With::Xml::xml(): With::Xml=HASH(0x7f9b998040b0) With::Xml::last_name(): With::Xml=HASH(0x7f9b998040b0)

— Ken