windows9download

You Here : Home > Linux

D'oh::Year 0.06

OS Support:


Publisher

Publisher Old version

Update:

March 19 2012

Download:

D'oh::Year 0.06


Description

Catch stupid mistakes when mucking with years, like Y2K bugs NO, PERL DOES NOT HAVE A Y2K BUG! but alot of people seem determined to add it. Perl, and most other languges through various historical reasons, like to return years in the form of the number of years since 1900. This has led to the false assumption that its actually returning the last two Digits of the current year (1999 => 99) and the mistaken assumption that you can set the current year as "19$year".This is a Y2K bug, the honor is not just given to COBOL progrmamers.Bugs of this nature can easily be detected (most of the time) by an automated process. This is it.When the D'oh::Year module is used, it provides special versions of localtime() and gmtime() which return a rigged value for the year. When used properly (usually 1900 + $year) you'll notice no difference. But when used for EVIL it will die with a message about misuse of the year.The following things are Naughty (where $year is from gmtime() or localtime()): "19$year", 19.$year "20$year", 20.$year "200$year", 200.$year $year -= 100, $year = $year - 100;THE FOLLOWING ARE THE CORRECT WAYS TO MANIPULATE THE DATE Take note, please. $year += 1900; # Get the complete year. $year %= 100; # Get the last two digits of the year. # ie "01" in 2001 and "99" in 1999SYNOPSIS use D'oh::Year;  ($year) = (localtime)[5]; print "We're going to party like its 19$year"; # No you're not.  print "Welcome to the year 20$year!"; # Sorry, Buck.


Related Downloads


  • Koha Stow Extras beta
  • Koha Stow Extras: This is a set of PHP/MySQL tools in production use at Stow-Munroe Falls Public Library Tools for reserves, circulation, reference, catalogers....

  • GroupLog planning
  • GroupLog - a php/mysql e-learning web application for supporting collaborative group work with large student cohorts. This project is part of the JISC (UK) eTools...

    Software Tags

    D'oh::year | D'oh::year 0.06 | D'oh::year Free Download | D'oh::year Reviews | Download D'oh::year

    Size :

    Next/Pre