Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Perl scripts on a Win98 pc?

Posted on 2000-04-13
3
246 Views
Last Modified: 2013-12-25
I need to build some interactive stuff on a remote NT box. so:
1-is there any way to debug perl cgi scripts when you can't get to a command line?

I thought I'd put perl on my pc and use Win98's Personal Web Server. Only perl I could find was 46 megs (!) of v. 5.6 from ActivePerl--nothing earlier or simpler.

In any case, PWS doesn't seem to recognize/find it. (yes, guys. perl seems to run its own example scripts perfectly well, so I assume IT is installed ok.)

Is this combination IMpossible, and if so, is there anything else that works?

Else: (back to first question, but local now): is there any way to debug perl cgi scripts on a Win98 pc?

Thanks.

Marilyn Justman
0
Comment
Question by:mjustman
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
maneshr earned 100 total points
ID: 2712418
"1-is there any way to debug perl cgi scripts when you can't get to a
command line? "

you can do that in either of the 2 ways.

1) by embedding print statements withon your PERL code.

2) by using a debugging variable to switch on/off the debug messages

Eg.

#!/usr/local/bin/perl

$DEBUG=1; ## 1=debug on, 0=off

print "Content-type: text/html\n\n";

print "Debug is on!!<br>\n" if $DEBUG;

$var="testing";

print $var,"<br>\n";

the above is assuming that you have succesfully configured PWS to allows PERL to run with it.

2) here is how you can set up M.S. PWS to run Perl.

Setting up M.S. PWS to run Perl

                       Prerequisites:

                       The Microsoft Personal Web Server (MS PWS) must be installed on the system.

                       Steps:

                          1.Download Perl for Windows 95/NT
                          2.Create a Perl5 folder on your hard drive and extract the contents of the self-extracting .exe
                            to that directory; remember to preserve the folder names and file names.

                            Your directory layout should look like the following after the extract:

                            \Perl5\bin
                            \Perl5\docs
                            \Perl5\eg
                            \Perl5\lib

                          3.Run the perlw32-install.bat batch file from the \Perl5\bin directory.
                          4.Make sure that the installation updated your path in your c:\autoexec.bat file to include
                            x:\Perl5\bin (where x: is the drive letter you installed Perl).

                       The above steps will install Perl 5 on your Windows 95/NT PC.  The steps below will configure the
                       Microsoft Personal Web Server to run Perl5.

                          1.Click on Start, Run, regedit.exe
                          2.Expand HKEY_LOCAL_MACHINE
                          3.Expand System
                          4.Expand CurrentControlSet
                          5.Expand Services
                          6.Expand W3Svc
                          7.Expand Parameters
                          8.Expand Script Map
                          9.Right click within the right pane/frame (of Script Map) and select New, string value.
                         10.Enter .pl
                         11.Modify .pl and enter the full path to the perl.exe program along with "%s %s"

                            example:  e:\Perl5\bin\perl.exe %s %s

                         11.Create additional entries for ".cgi" and ".plx"
                         12.Exit Regedit.
                         13.If MS PWS is running then, then start and stop http services.

See http://support.microsoft.com/support/kb/articles/Q150/6/29.asp  if you have any questions concerning the above steps.

The steps below will set up a cgi-bin or cgi-local (your choice) folder for use to contain your Perl
                       scripts:

                          1.Start FrontPage Explorer, and change to Folder View.
                          2.If you don't currently have a cgi-bin or cgi-local folder, create a new folder and name it
                            cgi-bin or cgi-local within FrontPage Explorer.
                          3.Within FrontPage Explorer, right click on the cgi-bin (or cgi-local) folder and select
                            properties.
                          4.Check the box to allow scripts and folders to be run.

                       Do the following to test your set up:

                          1.Using notepad (or any text editor), enter the Perl script below, save it to your cgi-bin (or
                            cgi-local) directory and name it "env.cgi"

                            #!/usr/bin/perl
                            print "content-type: text/html\n\n";
                            print "<HTML><BODY><PRE>";
                            print "<ul>";
                            foreach (sort keys %ENV)
                            {
                                 print "<li> Env Var key: $_ value $ENV{$_}";
                            }
                            print "</ul>";
                            print "<br>";
                            print "</PRE></BODY></HTML>";
                            exit 0;

                          2.Now browse http://YOURLOCALHOST/cgi-bin/env.cgi 

                       Remember to substitute the name of your local PWS/host above.  Also replace "cgi-bin" with
                       "cgi-local" if you are using a "cgi-local" directory.

                       The above script should display all of the environment variables the server (PWS) can see.

                       PROBLEM SOLVING

                       If you do the above and it does not work, then check the following:

                            MIME types are set up for .cgi and .pl (to check / remove MIME types, start Windows
                            Explorer, click on view, options, file types).
                            Folder where you placed the CGI script is not marked execute (run).
                            Registry settings are not correct.
                            You are using the FrontPage Personal Web Server instead of the Microsoft Personal Web
                            Server.
                            You are browsing the .cgi or .pl as a file instead of a web address such as
                            http://default/cgi-bin/env.cgi 
                            The script you are using has syntax errors, logic errors, or does not output proper HTML.

=========================================
Also i would suggest you look at Activestate install notes on PERL (if you have not done that already) at..

http://www.activestate.com/ActivePerl/docs/faq/Windows/Install.html
0
 

Author Comment

by:mjustman
ID: 2712478
It's gotta be right! Too complicated to be wrong!

Thanks loads!  

I don't know if I'm more upset that it's going to take so much time to get it working, or more pleased that it's gonna work!

Actually, more pleased.  Thanks again.

Marilyn Justman
0
 
LVL 16

Expert Comment

by:maneshr
ID: 2712766
in case you still face any problems, post a Question with the same caption as this with 0 points and i will be happy to help you out with it.

Rgds
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
This article will show, step by step, how to integrate R code into a R Sweave document
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question