my $x = \*foo; undef *$x; #### my $x = 'foo'; { no strict 'refs'; undef *$x; } #### my $x = do { no strict 'refs'; \*{'foo'} }; undef *$x;