37 chars.
However, I would say two things about this. First using ' istead of :: is so ugly that it isn't worth the 1 stroke saving. Secondly, although Perl Golf involves bending the rules as much as possible, using modules just goes against the spirit of the game.
# 39
sub xmas1 {
use Date'Manip;Date_DayOfWeek+12,25,pop
}
# 41
sub xmas2 {
use Date'Calc':all';Day_of_Week+pop,12,25
}
Update: I saved 2 chars by using May Day instead of Christmas. The politics of that may appeal to someone.
:-)
# 37
sub xmas3 {
use Date'Manip;Date_DayOfWeek+5,1,pop
}
# 39
sub xmas4 {
use Date'Calc':all';Day_of_Week+pop,5,1
}
--
John.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.