in reply to help with algorithm

try this, it tested, it works:
for (1 .. 7) {push @days, $_ if ((2 ** $_) & $day_mask)}

Replies are listed 'Best First'.
Re: Re: help with algorithm
by sauoq (Abbot) on Nov 17, 2002 at 01:28 UTC
    for (1 .. 7) {push @days, $_ if ((2 ** $_) & $day_mask)}

    You didn't test it very well. You need 0..6 not 1..7.

    -sauoq
    "My two cents aren't worth a dime.";
    
      Oops, I check back, he said Sunday = 0, you are right.