in reply to The Null Mull (or, when OO needs more O)
Since the undef SV is shared between all undefined values, one could modify undef using a feature in Perl 5.8. (I only thought of this because of the solution to #13 of How's your Perl? (II)).
At the beginning of your program (possibly in a BEGIN block) (completely untested):
&Internals::SvREADONLY(\undef, 0); undef = Object::EveryMethod->new; &Internals::SvREADONLY(\undef, 1);
And override Object::EveryMethod for string/num/bool to behave like undef normally does.
"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: The Null Mull (or, when OO needs more O)
by dragonchild (Archbishop) on Nov 29, 2004 at 18:55 UTC | |
by hardburn (Abbot) on Nov 29, 2004 at 19:07 UTC | |
by dragonchild (Archbishop) on Nov 29, 2004 at 19:29 UTC | |
Re^2: The Null Mull (or, when OO needs more O)
by diotalevi (Canon) on Nov 29, 2004 at 21:49 UTC | |
by hardburn (Abbot) on Nov 29, 2004 at 21:52 UTC | |
by diotalevi (Canon) on Nov 29, 2004 at 22:07 UTC | |
by dragonchild (Archbishop) on Nov 30, 2004 at 13:35 UTC | |
by diotalevi (Canon) on Nov 30, 2004 at 14:07 UTC | |
|