How To Enable Variable References in Perl While Using Strict

I wanted to call a sub-routine based on a variable in Perl, like this:
1 2 |
our $role = 'master'; &$role; |
but it failed because of
:use strict
1 |
Can't use string ("master") as a subroutine ref while "strict refs" in use at /opt/continuent/tungsten/tools/tungsten_find_orphaned line 213. |
To enable using a variable as a reference, simply specify that to Perl:
1 2 |
use strict no strict "refs"; |
Leave Your Comment
All fields marked with "*" are required.