XP is just a number | |
PerlMonks |
Re: help with algorithmby larsen (Parson) |
on Nov 17, 2002 at 00:23 UTC ( [id://213476]=note: print w/replies, xml ) | Need Help?? |
First you convert $days_mask[$i] from decimal to binary: look here for an example (and it could be a good opportunity to dig into the mysteries of pack). Then you use the string of binary digits you obtained to inspest the "weeklyness" of an event. In your example, 10 is 1010 in binary: the 1 in the second position (position number 1, since you count from 0) tells that the event repeats every Monday. The same "trick" for the 1 in the third position.
In Section
Seekers of Perl Wisdom
|
|