Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.472.043 Times

D'oh::Year 0.06

Company: Michael G Schwern
Date Added: June 28, 2013  |  Visits: 287

D'oh::Year

Report Broken Link
Printer Friendly Version


Product Homepage
Download (36 downloads)



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".<br /><br />This is a Y2K bug, the honor is not just given to COBOL progrmamers.<br /><br />Bugs of this nature can easily be detected (most of the time) by an automated process. This is it.<br /><br />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.<br /><br />The following things are naughty (where $year is from gmtime() or localtime()):<br /><br /> "19$year", 19.$year<br /> "20$year", 20.$year<br /> "200$year", 200.$year<br /> $year -= 100, $year = $year - 100;<br /><br />THE FOLLOWING ARE THE CORRECT WAYS TO MANIPULATE THE DATE Take note, please.<br /><br /> $year += 1900; # Get the complete year.<br /> $year %= 100; # Get the last two digits of the year.<br /> # ie "01" in 2001 and "99" in 1999<br /><br />SYNOPSIS<br /><br /> use D'oh::Year;<br /> <br /> ($year) = (localtime)[5];<br /> print "We're going to party like its 19$year"; # No you're not.<br /> <br /> print "Welcome to the year 20$year!"; # Sorry, Buck.

Requirements: No special requirements
Platforms: *nix, Linux
Keyword: Assumption Current Difference Digits Gmtime Localtime Message Ohyear Print Quot Yearquot Return Year Years Yearthe
Users rating: 0/10

License: Freeware Size: 10.24 KB
USER REVIEWS
More Reviews or Write Review


D'OH::YEAR RELATED
Networking  -  Print Current Window Script 1.1
Print Current Window Script opens printer Dialogue to print the current Page
10 KB  
Libraries  -  App::datetime 0.964
App::datetime is a date and time considerations. Most Enterprise development includes processing of dates and times. There are many date and time modules on CPAN, and choosing the right one can be confusing. There are no special perl data types...
122.88 KB  
Web Browsers  -  LocalLink 0.5
A Firefox add-on that allows you to open link from context menu Have you ever wondered why file://-links work from local files (which have file://-URLs) but not from webpages (which have http://-URLs)? Do you have collections of local...
10.24 KB  
Libraries  -  pytimeago r11
pytimeago is a human-oriented representation of time deltas, a Python library. First, I shall define what time delta is. Since Δ generally means “difference”, we take time delta to stand for difference between two events in time. Quite...
2.05 KB  
Programming  -  Queue::Q4Pg::Lite 0.03
Queue::Q4Pg::Lite is a Perl module that offers a simple message queue using PostgreSQL, which supports pg_advisory_lock (version 8.2 or later). This algorithms was invented by http://d.hatena.ne.jp/n_shuyo/20090415/mq . Many...
40.96 KB  
Programming  -  Date::Holidays::PT 0.02
Date::Holidays::PT - Determine Portuguese public holidays SYNOPSIS use Date::Holidays::PT; my ($year, $month, $day) = (localtime)[ 5, 4, 3 ]; $year += 1900; $month += 1; print "Woohoo" if...
10.24 KB  
File Synchronizers  -  ExamDiff 1.6k
ExamDiff is a Freeware Windows tool for visual file comparison. Features include: - Toggles between the first and second files. - Automatically detects file changes and prompts the user to re-compare files. - One push re-compare function...
465 KB  
Libraries  -  Devel::STrace::Monitor 0.31
Devel::STrace::Monitor is a monitor interface component for Devel::STrace. SYNOPSIS # # open the mmaped file # use Devel::STrace::Monitor; my $view = Devel::STrace::Monitor->open(somefile.map); my $cycles = 0; while (1) { print...
18.43 KB  
Libraries  -  Regexp::Common::time 0.01
Regexp::Common::time Perl module contains date and time regexps. SYNOPSIS use Regexp::Common qw(time); # Piecemeal, Time::Format-like patterns $RE{time}{tf}{-pat => pattern} # Piecemeal, strftime-like patterns $RE{time}{strftime}{-pat =>...
35.84 KB  
Multimedia & Graphics  -  gajim-status 0.9
gajim-status is a simple Amarok script to update your Gajim status with the current played song. Available keywords: %album, %artist, %bitrate, %title, %genre, %track, %year /* Rename the file to gajim-status.amarokscript.tar before trying...
20.48 KB  
NEW DOWNLOADS IN LINUX SOFTWARE, PROGRAMMING
Linux Software  -  EasyEDA PCB Designer for Linux 2.0.0
EasyEDA, a great web based EDA(Electronics Design Automation) tool, online PCB tool, online PCB software for electronics engineers, educators, students, makers and enthusiasts. Theres no need to install any software. Just open EasyEDA in any...
34.4 MB  
Linux Software  -  wpCache® WordPress HTTP Cache 1.9
wpCache® is a high-performance, distributed object, caching system application, generic in nature, but intended for use in speeding up dynamic web applications, by decreasing database load time. wpCache® decreases dramatically the page...
3.51 MB  
Linux Software  -  Polling Autodialer Software 3.4
ICTBroadcast Auto Dialer software has a survey campaign for telephone surveys and polls. This auto dialer software automatically dials a list of numbers and asks them a set of questions that they can respond to, by using their telephone keypad....
488 B  
Linux Software  -  Total Video Converter Mac Free 3.5.5
Total Video Converter Mac Free developed by EffectMatrix Ltd is the official legal version of Total Video Converter which was a globally recognized brand since 2006. Total Video Converter Mac Free is a free but powerful all-in-one video...
17.7 MB  
Linux Software  -  Skeith mod_log_sql Analyzer 2.10beta2
Skeith is a php based front end for analyzing logs for Apache using mod_log_sql.
47.5 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB