Half-interval working in Perl