#! perl -slw use strict; use 5.010; sub FOO () { 'foo' } BEGIN { undef $::{FOO} } say defined &FOO ? 'subroutine defined' : 'subroutine undef'; say eval 'FOO if $false; 1' ? 'FOO allowed' : 'FOO not allowed'; __END__ C:\test>660264.p10 subroutine undef FOO not allowed