Dunce::time

Dunce::time is a Perl module that protects against sloppy use of time.
Download

Dunce::time Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Tatsuhiko Miyagawa
  • Publisher web site:
  • http://search.cpan.org/~miyagawa/

Dunce::time Tags


Dunce::time Description

Dunce::time is a Perl module that protects against sloppy use of time. Dunce::time is a Perl module that protects against sloppy use of time.SYNOPSIS use Dunce::time; my $this = time; my $that = time; my @sorted = sort $this, $that; # die with an error my @numerically_sorted = sort { $a $b } $this, $that; # OKOn Sun Sep 9 01:46:40 2001 GMT, time_t (UNIX epoch) reaches 10 digits. Sorting time()'s as strings will cause unexpected result after that.When Dunce::time is used, it provides special version of time() which will die with a message when compared as strings.USAGEJust use the module. If it detects a problem, it will cause your program to abort with an error. If you don't like this behavior, you can use the module with tags like ":WARN" or ":FIX". use Dunce::time qw(:WARN);With ":WARN" tag, it will just warn instead of dying. use Dunce::time qw(:FIX); @sorted = sort @time; # acts like sort { $a $b } @time;With ":FIX" tag, it will warn and change the comparison behaviour so that it acts like compared numerically. Requirements: · Perl


Dunce::time Related Software