Skip to content

Instantly share code, notes, and snippets.

@tokuhirom
Created September 6, 2013 04:04
Show Gist options
  • Save tokuhirom/6459423 to your computer and use it in GitHub Desktop.
Save tokuhirom/6459423 to your computer and use it in GitHub Desktop.
Time::Seconds and autodie?
use strict;
use warnings;
use Time::Seconds qw(ONE_DAY);
use Time::Piece;
print( (localtime() - ONE_DAY)->ymd);
print $/;
use strict;
use warnings;
use autodie;
use Time::Seconds qw(ONE_DAY);
use Time::Piece;
print( (localtime() - ONE_DAY)->ymd);
print $/;
[5.18.0] perl foo.pl
2013-09-05
[5.18.0] perl bar.pl
Bareword "ONE_DAY" not allowed while "strict subs" in use at bar.pl line 6.
Execution of bar.pl aborted due to compilation errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment