in reply to Re^2: Removing CODE slot in typeglob / Reversing "use subs ...;"
in thread Removing CODE slot in typeglob / Reversing "use subs ...;"
Again, I'm only adressing the symptoms rather than thinking things through, but how's this?
#! perl -slw use strict; use 5.010; our $FOO = 'fred'; sub FOO () { 'foo' } BEGIN { undef $::{FOO}{CODE} } say defined &FOO ? 'subroutine defined' : 'subroutine undef'; say eval 'FOO if $false; 1' ? 'FOO allowed' : 'FOO not allowed'; print $FOO; __END__ C:\test>660264.p10 subroutine defined FOO not allowed fred
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Removing CODE slot in typeglob / Reversing "use subs ...;"
by lodin (Hermit) on Jan 03, 2008 at 18:58 UTC | |
by BrowserUk (Patriarch) on Jan 03, 2008 at 19:13 UTC | |
by lodin (Hermit) on Jan 03, 2008 at 19:24 UTC |