Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Search

 
Advanced search

8043 Posts in 1856 Topics- by 2099 Members - Latest Member: roi
Pages: [1]   Go Down
Print
Author Topic: Error message in calendar_admin.pl  (Read 494 times)
0 Members and 1 Guest are viewing this topic.
Porkie
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« on: June 27, 2006, 12:54:00 AM »

I am just trying to set up calendar to run locally on an Abyss web server on XP Home/Firefox.

I believe I have installed everything needed correctly, but admit to be groping in the dark somewhat as I haven't set up anything using cgi scripts before.

The Calendar script debugger reports no errors, but I get the following error in the cgi.log when I run calendar_admin.pl and calendar.pl. Abyss reports error 500

===***=== CGI Log file
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   Bareword found where operator expected at calendar_admin.pl line 18, near "if (defined $main::Session && ref($main::Session) eq "CGISession"
 (Might be a runaway multi-line "" string starting on line 13)
   (Do you need to predeclare if?)
String found where operator expected at calendar_admin.pl line 22, near "if ($BASE_DIR ne ""
 (Might be a runaway multi-line "" string starting on line 18)
   (Missing semicolon on previous line?)
String found where operator expected at calendar_admin.pl line 26, near "print ""
 (Might be a runaway multi-line "" string starting on line 22)
   (Missing semicolon on previous line?)
syntax error at calendar_admin.pl line 18, near "if (defined $main::Session && ref($main::Session) eq "CGISession"
BEGIN not safe after errors--compilation aborted at calendar_admin.pl line 22.
CGI: [C:\Perl\bin\perl.exe calendar_admin.pl ]   URI: /calendar/calendar_admin.pl   Broken pipe

===***=== end of log file

The following is the first section of code from the calendar_admin.pl script. I have changed the path to the calendar script file manually

===***=== Calendar_admin.pl file
#!C:\Perl\bin\perl.exe
#
# CalendarScript
# Version: 3.21
#
# Copyright 2003 Scott
# http://www.CalendarScript.com/
#

BEGIN {
   # CHANGE THE LINE BELOW IF NECESSARY
   # Be sure to remove the # before $BASE_DIR, and change the path between the quotes
   $BASE_DIR = "C:\Program Files\Abyss Web Server\htdocs\Calendar\";
   
   # DO NOT CHANGE ANYTHING BELOW HERE!

   sub exitGracefully() {
      if (defined $main::Session && ref($main::Session) eq "CGISession") { $main::Session->saveSession(); }
      exit(0);
      }

   if ($BASE_DIR ne "") { $BASE_DIR =~ s|([^/])$|$1/|; }
   else {
      my ($path) =  $ENV{'PATH_TRANSLATED'} | | $ENV{'SCRIPT_FILENAME'};
      unless ($path) {
         print "Content-type:text/html\n\n<B>ERROR:</B><BR>Your server does not provide the PATH_TRANSLATED or SCRIPT_FILENAME environment variables.<br><br>Please see the installation documentation for how to set the \$BASE_DIR variable manually.";
         &exitGracefully();
         }
      $path =~ s|[^/\\]*$| |;
      $path =~ s|\\|/|g;
      $path =~ s|/+|/|g;
      $path =~ s|([^/])$|$1/|;
      $BASE_DIR = $path . "calendarscript/";
      }
   unshift(@INC,$BASE_DIR."lib");
   unshift(@INC,$BASE_DIR."plugins");

===***=== eof

Any ideas and help gratefully received, and thanks in advance

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #1 on: June 27, 2006, 09:22:00 PM »

**  Abyss web server **

I'm afraid I am not at all familiar with that product.

** Bareword found where operator expected at calendar_admin.pl line 18, near **

What exactly is on line 18 (and 17 and 19) of that file?

Dan O.

------------------

Logged
Porkie
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #2 on: June 28, 2006, 01:05:00 AM »

Hi Dan O

I included the first 25 or so lines of calendar_admin.pl. I am not conversant with the code and errors, if it was basic I would be OK!

Thanks for helping

Regards

Brian

------------------

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #3 on: June 28, 2006, 01:08:00 AM »

** I included the first 25 or so lines of calendar_admin.pl **

Great! But which of those are the ones I asked about?

Dan O.

------------------

Logged
Porkie
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #4 on: June 28, 2006, 05:48:00 AM »

I guess you count down 19 lines from the start of the listing of calendar_admin which I placed at the end of the first posting.

------------------

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #5 on: June 28, 2006, 12:27:00 PM »

Considering at least the following line has likely wrapped (displayed on multiple line) when posted here in the forum, I don't think that would be would be accurate? ... which is why I asked. :/

"Content-type:text/html\n\n<B>ERROR:</B><BR>Your server does not provide the PATH_TRANSLATED or SCRIPT_FILENAME environment variables.<br><br>Please see the installation documentation for how to set the \$BASE_DIR variable manually.";


Good luck anyway!

Dan O.

------------------

Logged
Porkie
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #6 on: July 01, 2006, 08:11:00 PM »

Hi Dan,

I have installed a perl IDE, and done some more research, but without some more help I will have to learn perl completely to solve this issue.

I believe the error is in the following lines:

11 # CHANGE THE LINE BELOW IF NECESSARY
12 # Be sure to remove the # before $BASE_DIR, and change the path between the quotes
13 $BASE_DIR = "C:\Program Files\Abyss Web Server\htdocs\Calendar\";
14
15 # DO NOT CHANGE ANYTHING BELOW HERE!
16
17 sub exitGracefully() {
18   if (defined $main::Session && ref($main::Session) eq "CGISession") { $main::Session->saveSession(); }
19       exit(0);
20      }
21
22   if ($BASE_DIR ne "") { $BASE_DIR =~ s|([^/])$|$1/|; }
23   else {
24      my ($path) =  $ENV{'PATH_TRANSLATED'} | | $ENV{'SCRIPT_FILENAME'};

The error is in line 22
String found where operator expected at calendar_admin.pl line 22, near "if ($BASE_DIR ne ""

You will see I have entered a value for $BASE_DIR on line 13,  and if I understand how perl works , the execution of line 22 is TRUE for ($BASE_DIR ne ""), therefore it is executing
{ $BASE_DIR =~ s|([^/])$|$1/|; }

Which is incomprehensible to me given my current level of perl.

Can you provide any enlightenment?

Regards

Brian

------------------

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #7 on: July 01, 2006, 10:05:00 PM »

** String found where operator expected at calendar_admin.pl line 22, **

Why is the error at a different line now?

**  have entered a value for $BASE_DIR  **

Yes, an incorrect one. The path either has to have forward slashes ("/") or you'll have to escape the back slashes (eg. C:\\Program Files\\Abyss... ) as Perl knows those symbols as escape characters.

You may have to change the shebang too? I don't know, I don't do Windows?.

Dan O.

------------------

Logged
Porkie
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #8 on: July 02, 2006, 12:01:00 AM »

Hi Dan,

Forward slashes in file path did it, as well as going down one more level.

Thanks for your help - it does work with Abyss and Windows!

Regards

Brian

------------------

Logged
Pages: [1]   Go Up
Print
Jump to: