Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Posts
    100
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Configuring Perl :o)

    I'm getting myself all worked up about this, but I imagine it is one of the easiest things to do.

    Can you help me? Here is my problem.

    I have recently downloaded the program Perl, with the intention of configuring my scripts on my machine before uploading them onto my site to save bandwidth usage. However, the settings I have to use for the 'Path to Perl' and Sendmail is "C:\BLAH\BLAH\USR\BIN\PERL.EXE".

    What I'd like to know is how web servers make this into just #/usr/bin/perl. As when I change to this, it refuses to operate properly.

    I am currently running Apache on Windows ME and everything seems fine other than this.

    What do I need to do to make this work?

    Any Help would be hugely appreciated.

    Thanks in advance.
    Leon

  • #2
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts
    The shebang line (#!) is used to giva a path to the perl interpreter.

    On a windows system, this means all your perl scripts must start with #!c:\blah\blah\usr\bin\perl.exe

    and before you upload to your unix box (or web server) you need to change this to #!\usr\bin\perl

    If you have a good text editor that can do a replace on multiple files, this is pretty easy.

    If you put perl in your apache folder and configure the sub-directories to match your server.

    Example:
    On you server the path to perl is \usr\bin\perl

    so on your computer you would need to place the perl executable in c:\blah\blah\apache\usr\bin\perl

    Then you can use the same #! line for both. On the web server, it's an absolute path, and on your comp it's a relative path, but they both work the same!

  • #3
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts
    Oh, I just thought of another thing which I think works, If you modify your PATH variable in DOS to point to the PERL exe you can call perl from anywhere.

    You can do this by the following,
    Goto DOS
    type:
    SET PATH=%PATH%;c:\blah\blah\usr\bin\perl.exe

    then hit return.

    Then, if I remember correctly, perl will execute from anywhere on the machine. Someone can check this for me though.

  • #4
    Regular Coder
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    126
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yep, and if you downloaded the ActiveState Windows Perl interpreter this should have been done automatically.

    You don't really need to worry with the shebang line in windows too much after you've got this done, so what I do is for my windows machine scripts, I put #!/usr/bin/perl for the shebang line, since this is what my remote webhost requires.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •