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

Quote Reply
Re: Help with Error In reply to
You need to associate .cgi files with Perl.exe on your machine.
Use Folder Options to add this filetype if it's not already there.
Quote Reply
Re: Help with Error In reply to
Do you mean with IIS? I've set the Apps Mapping so that .cgi is run by perlls.dll, and just to make sure I went into the control panel, folder options, and associated cgi with perl there also. Samething, when I go to the admin it tries to download the results instead of displaying them. And of course I still get the error. Thanks.

Mike
Quote Reply
Re: Help with Error In reply to
The error is not in the extension (You would'
ve seen a completely different error message), but in the following line of codes:

Code:
$build_site_title = 'Maine-Business's Links';

You need to include the Perl escape character \ before the second apostrophe.

Code:
$build_site_title = 'Maine-Business\'s Links';

This error is NOT server related or CGI related, but Perl related.

Wink

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: Help with Error In reply to
Thanks! I added the \ and boom, there it was. Havn't worked on it yet, but it came up. Thanks to you both for the help!

Mike
Quote Reply
Re: Help with Error In reply to
You're welcome.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.