>How long would it take the average Perl programmer to a) find >DateTime::Event::Recurrence in the DateTime docs and I agree that it's hard to find, I only came across it on the third rewrite of a script where I was doing this.
> b) understand that the scalar context of a function returns the number of >elements? Umm, scalar by definition counts the number of elements of a list. There is not standard as to what functions should do in different contexts, but having a function in scalar context return the number of elements that would be in the list (instead of building it up) is perfectly reasonable. Think of as_list as being a grep(). >And the lingo isn't even accurate: If as_list() truly returned a list, >the result in scalar context would be largely surprising. See above. >I guess it returns an array, not a list, right? The list/array semantics argument is outside of the scope of this discussion. >Probably something like subtract_datetime_absolute_in_days() would >be easier to grasp (referring to subtract_datetime_absolute() which does >something similar). Or maybe even something like Well, there's delta_days (just above your absolute thing). But yeah, both of yours clear. And what if I want weeks? Wednesdays? IMHO Recurrence really is the best tool I know. It's just not well known and perhaps not as thoroughly/obviously documented as it could be. -- H4sICNoBwDoAA3NpZwA9jbsNwDAIRHumuC4NklvXTOD0KSJEnwU8fHz4Q8M9i3sGzkS7BBrm OkCTwsycb4S3DloZuMIYeXpLFqw5LaMhXC2ymhreVXNWMw9YGuAYdfmAbwomoPSyFJuFn2x8 Opr8bBBidccAAAA= -- MOTD on Sweetmorn, the 48th of Discord, in the YOLD 3172: Oh, my God! ARTHUR, I HAVE POCKETS!