The stupid question is the question not asked PerlMonks

### Re: Determining if I have a particular Friday off

by choroba (Bishop)
 on Oct 24, 2012 at 16:46 UTC ( #1000669=note: print w/replies, xml ) Need Help??

Does not the following do the same?
```print +(localtime)[7] / 7 % 2 ? "Free\n" : "Work\n";
(You might need to switch Free and Work).
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: Determining if I have a particular Friday off
by thmsdrew (Scribe) on Oct 24, 2012 at 17:33 UTC

No. No it doesn't.

Re^2: Determining if I have a particular Friday off
by RedElk (Hermit) on Oct 24, 2012 at 18:39 UTC

Is it true that this is telling me whether or not I work the Friday of this week? If so, it worked for me. However, I did have to swap "free/work".

How does dividing the \$yday by 7 with remainder of 2 get one to a Friday - or did I misunderstand?

UPDATE: Ah, it provides the odd even week.

I am generally aware of my schedule for the current week, so this isn't particularly helpful. (I need to know if I'm working the current week's Friday so I can record my time properly!)

Yeah, I concur. But, FWIW it was easy to extend for a minimal forecast:

```#! usr/local/bin/perl
# rdo.pl

use strict;
use warnings;

print +(localtime)[7] / 7 % 2 ? "This Friday: Work\n" : "This Friday:
+Free\n";
print +(localtime)[7] +1 / 7 % 2 ? "Next Friday: Work\n" : "Next Frida
+y: Free\n";
print +((localtime)[7] +2) / 7 % 2 ? "Friday the week after: Work\n" :
+ "Friday the week after: Free\n";

Create A New User
Node Status?
node history
Node Type: note [id://1000669]
help
Chatterbox?
 [Discipulus]: the new spam: gdpr consensus mail [Corion]: Yeah, but the hope is that when I just delete it I won't receive any more mail from them [Corion]: ... a faint hope, I know [Discipulus]: ah ah you are still so optimist, Corion ? ;=) [Discipulus]: here we are a bit late: i'll inject a ransomware to crypt everything and be compliant

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2018-05-25 07:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
World peace can best be achieved by:

Results (181 votes). Check out past polls.

Notices?