in reply to How to add a day using Time::Piece

Basic debugging checklist
#!/usr/bin/perl -- use strict; use warnings; use Time::Piece; my $t = gmtime; print $t->ymd . "\n"; $t += ONE_DAY; print $t->ymd . "\n"; my $t2 = $t + ONE_DAY; print $t2->ymd . "\n"; __END__ Bareword "ONE_DAY" not allowed while "strict subs" in use at - line 8. Bareword "ONE_DAY" not allowed while "strict subs" in use at - line 10 +. Execution of - aborted due to compilation errors.

Replies are listed 'Best First'.
Re^2: How to add a day using Time::Piece
by bangor (Monk) on Nov 20, 2014 at 04:21 UTC
    Ah, thank you, as you say 'basic'. I thought that the constant ONE_DAY was from Time::Piece but it is in fact from Time::Seconds. Adding the line 'use Time::Seconds;' fixed it.