bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Texinfo 6.2 released


From: Norbert Preining
Subject: Re: Texinfo 6.2 released
Date: Sat, 10 Sep 2016 23:48:42 +0900
User-agent: Mutt/1.5.21 (2010-09-15)

On Sat, 10 Sep 2016, Gavin Smith wrote:
> sub expand_today($)
> {
>   my $self = shift;
>   if ($self->get_conf('TEST')) {
>     return {'text' => 'a sunny day'};
>   }
>   my($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst)
>    = localtime(time);
>   $year += ($year < 70) ? 2000 : 1900;
>   return $self->gdt('{month} {day}, {year}',
>           { 'month' => $self->gdt($MONTH_NAMES[$mon]),
>             'day' => $mday, 'year' => $year });
> }

Indeed, this is really strange.

> 
> This is perl 5, version 18, subversion 1 (v5.18.1) built for

5.22 here, but running a test file:
#!/usr/bin/perl

$^W = 1;
use strict;

sub expand_today($)                                                             
{                                                                               
  my $self = shift;                                                             
  my($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst)               
   = localtime(time);                                                           
  $year += ($year < 70) ? 2000 : 1900;                                          
  return $year;
}                                                                               

my $foo = expand_today(42);
print "returned $foo\n";

did work without any problem. So maybe there is something protecting
$year in the way it is called? 

I have absolutely no idea, sorry.

Norbert

--
PREINING Norbert + TeX Live & Debian Developer + http://www.preining.info
GPG: 0x860CDC13    fp: F7D8 A928 26E3 16A1 9FA0  ACF0 6CAC A448 860C DC13



reply via email to

[Prev in Thread] Current Thread [Next in Thread]