http://www.perlmonks.org?node_id=914984

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

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"); print "$a\n".$a->mdy("/")."\n";

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?