Gossamer Forum
Quote Reply
Help with Error
Hi There,

I'm trying to install Links 2 on a Windows 2000 box running IIS v5 and everytime I try and run the admin.cgi it downloads it instead of displaying it on the screen. When I save it and open it I get this:

Error including libraries: syntax error at D:\WWW\maine-business\cgi-bin\links\admin/links.cfg line 163, near "$time = &Time::Loc"
(Might be a runaway multi-line LL string starting on line 136)

Make sure they exist, permissions are set properly, and paths are set correctly.

Here is the section from my links.cfg:

# Site Title, the default title to use. You should really spend some time customizing
# the directory though!
$build_site_title = 'Maine-Business's Links';

# Date Routines
# --------------------------------------------------------
# Your date format can be whatever you like, as long as the following
# two functions are defined &date_to_unix and &unix_to_date:
# The default is dd-mmm-yyyy.

sub date_to_unix {
# --------------------------------------------------------
# This routine must take your date format and return the time a la UNIX time().
# Some things to be careful about..
# timelocal does not like to be in array context, don't do my($time) = timelocal (..)
# int your values just in case to remove spaces, etc.
# catch the fatal error timelocal will generate if you have a bad date..
# don't forget that the month is indexed from 0!
#
my $date = shift; my $i;
my %months = map { $_ => $i++ } qw!Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec!;
my ($day, $mon, $year) = split(/-/, $date);

exists $months{$mon} or return undef;
$day = int($day); $year = $year - 1900;

require Time::Local;
my $time = 0;
eval {
$time = &Time::Local::timelocal(0,0,0, $day, $months{$mon}, $year);
};
if ($@) { die "invalid date format: $date - parsed as (day: $day, month: $months{$mon}, year: $year). Reason: $@"; }
return $time;
}

I must tell you that I am NOT a programmer, so go easy on me <grin>. Thanks for Any Help!

Mike
WebMaster@Maine-Business.Com

Subject Author Views Date
Thread Help with Error Mikeach 3399 May 4, 2000, 7:42 AM
Post Re: Help with Error
Temsi 3294 May 4, 2000, 1:22 PM
Post Re: Help with Error
Mikeach 3292 May 4, 2000, 2:45 PM
Post Re: Help with Error
Stealth 3294 May 4, 2000, 3:10 PM
Post Re: Help with Error
Mikeach 3291 May 4, 2000, 4:32 PM
Post Re: Help with Error
Stealth 3307 May 4, 2000, 4:43 PM