Subject: | from_epoch does not accept an overloaded object |
I overloaded time() to return a DateTime object which numifies to an
epoch. I handed that to DateTime->from_epoch( epoch => $time ) and got...
The 'epoch' parameter ("1241307069") to DateTime::from_epoch was a
'hashref object', which is not one of the allowed types: scalar
at
/usr/local/perl/5.10.0/lib/site_perl/5.10.0/darwin-thread-multi-2level/DateTime.pm
line 452
DateTime::from_epoch(undef, 'epoch', 'DateTime::time=HASH(0xa6f8a0)',
'formatter', 'DateTime::Format::CTime') called at lib/perl5i.pm line 202
DateTime is being too picky and piercing the transparency of
overloading. It should allow an object, or it can take a more specific
type like NUMBER which just checks that the argument acts like a number.