in reply to Special undefs with attributes

You could concoct something with tie, where a tied variable's object instance possesses additional attributes besides its primary value (which may indeed be undef).


Dave

Replies are listed 'Best First'.
Re^2: Special undefs with attributes
by bsb (Priest) on Sep 25, 2006 at 03:57 UTC
    sub FETCH { return undef } works for defined($undef) and (tied $undef)->{exists} can store out of band properties.

    I couldn't get this to round-trip with YAML, I guess special serialization code would be required, either using YAML::Node or some caller() checking kludge in FETCH.

    Then deserializing would need another hack... nevermind

    Brad