How to make DateTime::Duration output only in days?

At first you need to do the correct subtraction. There exists delta_md, delta_days, delta_ms and subtract_datetime_absolute. Depending on which unit you later want, you need to pick the right subtraction. The problem is that not every unit is convertible later without time_zone information. Thats the reason why you need to pick the correct delta method. … Read more

Can a Perl script install its own CPAN dependencies?

Each of the standard build paradigms has their own way of specifying dependencies. In all of these cases, the build process will attempt to install your dependencies, automatically in some contexts. In ExtUtils::MakeMaker, you pass a hash reference in the PREREQ_PM field to WriteMakefile: # Makefile.PL for My::Module use ExtUtils::MakeMaker; WriteMakefile ( NAME => ‘My::Module’, … Read more