I am trying to keep some content from displaying on my website during holidays, I have the following.
$mday is the day of the month, $mon is month number which I am matching to an array of month names, first I check to see if the month contains a holiday then I check to see what day it is and finally if they are both a match I hide the chat, my problem is that on my third regex it matches any day that has a one in it which is not what I want, I only want like 1, and 18, how can I fix this? I am looking for a very simple solution as this website will be phased out by the end of the year, which is why I didn't do date:manip or business:date or whatever to do this.
my @abbr=qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
if ($abbr[$mon]=~/Jan|Feb|May|Jul|Sep|Oct|Nov|Dec/)
{
# $response writes are old code debug write outs.. $Response->wri
+te("$abbr[$mon] $mday");
if (($abbr[$mon]=~/Jan/) && ($mday=~/1|18/))
{
#close chat for these days..
$str.="</config>";
return $str;
#$response->write("Happy New Year");
}
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.