in reply to Meet Slang!

use 5.010; use strict; use warnings; sub foo { say "This is foo <@_>" } sub bar { say "This is bar <@_>" } sub call { my $sub = shift; goto &$sub; } $_ = "foo 123 foo bar bar 456"; while (/(\w+) (\w+)/g) { call $1, $2; } __END__ This is foo <123> This is foo <bar> This is bar <456>
The above avoids no strict 'refs', but it doesn't actually buy you anything.

Adapting it to your own templating system (which neither seems useful, working or fast to me) is left as an exercise to the reader.

P.S. I graduated from university long before you flunked college. (Not that anyone should care).

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.