y2k.pm

filter: Statementstmt 100% 20 / 20 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 100% 25 / 25 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« D/oh/Year.pm ↑ Summary
1 package y2k;
2  
3 1 ▶use D'oh::Year qw(:DIE);
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 $VERSION = 0.10;
8  
9 1 ▶sub import {
Subroutine import: called CC=1 SCAR=0.0
10 1 my $caller = caller;
11 {
12 1 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 *{$caller . '::localtime'} = \&localtime;
14 1 *{$caller . '::gmtime'} = \&gmtime;
15 }
16 }
17  
18 =pod
19  
20 =head1 NAME
21  
22 y2k - A simple module to detect y2k bugs
23  
24  
25 =head1 SYNOPSIS
26  
27 use y2k;
28  
29 $year = (localtime)[5];
30 print "19$year is a good year to die";
31
32  
33 =head1 DESCRIPTION
34  
35 Most Y2k bugs written in Perl are typically very easy to catch. This module catches
36 them. The idea is simple, it provides its own loaded versions of localtime()
37 and gmtime() which return trick years. If this year is used in a manner which is
38 not "cross-decade compliant", your program will die with an error.
39  
40 This is a thin legacy wrapper around D'oh::Year. Use that instead.
41  
42  
43 =head1 SEE ALSO
44  
45 L<D'oh::Year>
46  
47  
48 =head1 AUTHOR
49  
50 Michael G Schwern <schwern@pobox.com>
51  
52 =cut
53  
54 1 return 19100;
« D/oh/Year.pm ↑ Summary