in reply to List of days in current month

As an option
($m, $d) = (localtime)[4, 3]; $b = time - ($d * 86400); while((localtime($b+=86400))[4] == $m){ print "",(localtime($b))[3],"\n"; }

Replies are listed 'Best First'.
Re^2: List of days in current month
by Anonymous Monk on Mar 14, 2014 at 14:14 UTC
    Not every day has 86400 seconds.
      Which ones dont?
        #!/usr/bin/perl use warnings; use strict; use DateTime; my $dt = 'DateTime'->new( year => 2014, month => 3, day => 14, hour => 0, minute => 0, second => 0, time_zone => 'America/New_York', ); while (1) { my $yesterday = $dt->clone; $yesterday->subtract(days => 1); my $diff = $dt->epoch - $yesterday->epoch; $dt = $yesterday; print "$dt\t$diff\n"; last if $diff != 60 * 60 * 24; }
        لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
        In the US, we just lost an hour this last weekend due to going off Daylight Savings Time. In the UK, they're doing it later this month. All so some guy could get more tee time...
Re^2: List of days in current month
by Lennotoecom (Pilgrim) on Mar 14, 2014 at 12:26 UTC
    dear critics if you minus,
    please be a dear and write down at least a little description
    exactly why. ty
    because simple haters are stupid, aren't they?
    update
    exactly what I thought