I have a variable, I need to access sometimes as a string and sometimes doing more sophistaced things as a module, The following, well simplified example, shoud then
print out two times a date - which not have to be the same.
my $a = dualvar(DateTime->now, "2011/07/17");
Using Scalar::Util's dualvar it is possible to store a string and a number in one var. According to the documentation, this should be possible for storing a string and a reference, too.
So, before getting the hands dirty on writing another module, is there a current implementation for this?