in reply to No strict refs
Of course, that only helps to circumvent the no strict 'refs';. It doesn't solve anything that no strict 'refs'; tries to protect you from.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>
Adapting the trick so it works with your templating system is left as an exercise to the reader.
|
|---|