Are you guys using another version of perl than I am? At least here, the !-operator binds more tightly than the %-operator, so that (!$_%4 &c) just won't work.
... or am I just giving away your joke now ... ?
Anyway, I guess this would work (checking the calendar). 65 chars; based on yours:
... or my best, so far, at 52:sub f { #234567890#234567890#234567890#234567890#234567890#234567890#234567890 +#234567890 for(1..($b=pop)++){$b++;$b--if$_%4;$b++if$_%100;$b--if$_%400}$b%7 }
sub f { #234567890#234567890#234567890#234567890#234567890#2 $b+=$_%400?$_%100?$_%4?0:1:0:1for 1..($b=pop)++;$b%7 }
Update: Checking the calendar again ...
The Sidhekin
print "Just another Perl ${\(trickster and hacker)},"
In reply to Re: Golfing the day of Christmas
by Sidhekin
in thread Christmas Coding Blues
by cacharbe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |