- or download this
use strict;
use warnings;
...
print shift, " date entry:\n";
return map { $_ => prompt "\tPlease enter $_:" } qw( day month year
+);
}
- or download this
Birth date entry:
Please enter day: 27
...
Please enter year: 2013
You are 21555 days old.
- or download this
use strict;
use warnings;
...
# Perform the math.
print "\nYou are ", $bday->delta_days($now)->in_units('days'), " days
+old.\n";