Playing with time in Perl

my $hour = (localtime(time))[2];

if ( $hour >= 22 && $hour <= 24 || $hour >= 0 && $hour <= 8 ) { print "Do something.n"; exit; }

Leave a Reply

Your email address will not be published. Required fields are marked *