Mailing List Archive

Er bug?
This script gives me the following output which I believe is a bug.

syntax error at get_date.pl.orig line 86, near "sub expand_int"
Can't use global @_ in "my" at get_date.pl.orig line 87.

The script is here..

#
#
#
#
get_date {
my($which) = @_;

# Todays date.
($mday,$mon,$year) = (localtime)[3..5];
$mon += 1;

# 4th year = leap year where february has 29 days..
if ($year !~ /4$/)
{
$february = '28';
}
else
{
$february = '29';
}

%calendar = (
'1','31',
'2',"$february",
'3','31',
'4','30',
'5','31',
'6','30',
'7','31',
'8','31',
'9','30',
'10','31',
'11','30',
'12','31'
);

if ($which eq 'yesterday')
{
if ($mday eq '1')
{
if ($mon eq '1')
{
$year -= 1;
$mon = 12;
$mday = $calendar{$mon};
}
else
{
$mon -= 1;
$mday = $calendar{$mon};
}
}
else
{
$mday -= 1;
}
}

if ($which eq 'tomorrow')
{
if ($mday eq "$calendar{$mon}")
{
if ($mon eq '12')
{
$year += 1;
$mon = 1;
$mday = 1;
}
else
{
$mon += 1;
$mday = 1;
}
}
else
{
$mday += 1;
}
}

($mday,$mon,$year) = &expand_int($mday,$mon,$year);
return "$mday/$mon/$year";

}

sub expand_int {
my(@date) = @_;

for (@date)
{
$_ =~ s/(.)/0$1/ if $_ =~ /^.$/;
}

return @date;
}

1;


Myconfig is here..

#!/bin/sh

# This script is designed to provide a handy summary of the configuration
# information being used to build perl. This is especially useful if you
# are requesting help from comp.lang.perl on usenet or via mail.

if test -f config.sh; then TOP=.;
elif test -f ../config.sh; then TOP=..;
elif test -f ../../config.sh; then TOP=../..;
elif test -f ../../../config.sh; then TOP=../../..;
elif test -f ../../../../config.sh; then TOP=../../../..;
else
echo "Can't find the perl config.sh file produced by Configure"; exit 1
fi
. $TOP/config.sh

$spitshell <<!GROK!THIS!

Summary of my $package (patchlevel $PATCHLEVEL) configuration:
Platform:
osname=$osname, osver=$osvers, archname=$archname
uname='$myuname'
hint=$hint
Compiler:
cc='$cc', optimize='$optimize', ld='$ld'
cppflags='$cppflags'
ccflags ='$ccflags'
ldflags ='$ldflags'
stdchar='$stdchar', d_stdstdio=$d_stdstdio, usevfork=$usevfork
voidflags=$voidflags, castflags=$castflags, d_casti32=$d_casti32, d_castneg=$d_castneg
intsize=$intsize, alignbytes=$alignbytes, usemymalloc=$usemymalloc, randbits=$randbits
Libraries:
so=$so
libpth=$libpth
libs=$libs
libc=$libc
Dynamic Linking:
dlsrc=$dlsrc, dlext=$dlext, d_dlsymun=$d_dlsymun
cccdlflags='$cccdlflags', ccdlflags='$ccdlflags', lddlflags='$lddlflags'

!GROK!THIS!


System is Freebsd 2.0.5 tested on Solaris 2.3 and failed also.

Bye
Peter Marelas