Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.85k stars 527 forks source link

More on Timelocal library bug using perl compiler of Perl 5.005_03 #122

Closed p5pRT closed 20 years ago

p5pRT commented 24 years ago

Migrated from rt.perl.org#926 (status was 'resolved')

Searchable as RT926$

p5pRT commented 24 years ago

From Angela.Huang@ebay.sun.com

p2.pl

p5pRT commented 24 years ago

From Angela.Huang@ebay.sun.com

p3.pl

p5pRT commented 22 years ago

From The RT System itself

use Time​::Local;

sub calculateage{ # # calculate the age of the patch according to current date #   $DAY = 24 * 60 * 60;   %MONTHS = ( "Jan"\, 0\,   "Feb"\, 1\,   "Mar"\, 2\,   "Apr"\, 3\,   "May"\, 4\,   "Jun"\, 5\,   "Jul"\, 6\,   "Aug"\, 7\,   "Sep"\, 8\,   "Oct"\, 9\,   "Nov"\, 10\,   "Dec"\, 11 );   ( $lmonth\, $day\, $year ) = split(/\//\, $_[0]);   $month = $MONTHS{$lmonth};   $start = timelocal( 1\, 1\, 1\, $day\, $month\, $year );   $end = time; print "testing​:start=$start\,end=$end\,day=$day\,month=$month\,yr=$year\n";   $age = int( ( $end - $start ) / $DAY ); }

##============================================== ## BEGIN ##============================================== #

@​home = ("couch"\, "chair"); #foreach $i (@​home) {   &calculateage("May/04/99"); # } #============================================== # END #==============================================

__END__

#!/bin/sh

LD_AOUT_PRELOAD=libperl.a ./perl -I. -Ilib utils/perlcc -o t1 -L . t1.pl && ./t1