my $x = 'Foo'; my $sub_ref = do { no strict 'refs'; \&{$x}; }; #### my $x = 'Foo'; my $sub_ref = \&{$x};