in reply to odd or even day?
#!/usr/bin/perl -w use strict; my $var=time/(24*60*60); print $var%2 ? "odd\n" : "even\n";
The only difference is the parentheses. I'm not sure why they are required. Perhaps somebody else can explain that...
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: odd or even day?
by GrandFather (Saint) on Jan 07, 2006 at 18:12 UTC | |
Re^2: odd or even day?
by demerphq (Chancellor) on Jan 07, 2006 at 18:13 UTC | |
by jondkent (Initiate) on Jan 07, 2006 at 18:46 UTC |