Re: beginner
by chromatic (Archbishop) on Aug 30, 2001 at 00:50 UTC
|
What are you trying to do?
If you're writing a Perl program to use as a CGI script, you'll need some sort of web server. There are lots of things to check there.
If you're not writing CGI, you'll have better luck downloading Perl itself, installing it on your machine.
The two are not mutually exclusive. | [reply] |
|
|
Chromatic. Thanks for being "beginner" understanding. I did download Perl and installed it following instructions from the website at ActivePerl.com
I am using Windows 98 and PWS so just testing a sample file using the browser was not displaying the output but I was getting a pop up to save or downoad the file. Strange. It sounds like perl extensions are not recognized. Although the installation of perl from that activeperl.com site should do that automatically.
Does what I said make any sense. I do need the help to get started. I appreciate your patience with me.
Regards,
Nick
| [reply] |
Perl scripts don't open correctly in browser
by boo_radley (Parson) on Aug 30, 2001 at 01:45 UTC
|
you're not doing anything wrong, actually.
using PSI::ESP, I have determined that you're using a win32 system of some sort, Internet Explorer 4.0 (or higher) and have some perl interpreter on your system.
What's happening is that IE is more concerned about the extension of the file type, rather than its content. It sees "foo.pl" and thinks "Do I have an association with .pl files? I do? Ok, perhaps the user would like to open the file remotely and use it's associated executable on it. Alternately, the user may wish to save this file, and work on it from the hard drive. Let's find out!"
So, when you save/open the script in your browser, you should see the intended output of the script, rather than the perl code.
So far, the only way I've successfully broken this behavior is to use a different broswer or to remove the .pl file association. :(
| [reply] |
Re: beginner
by fs (Monk) on Aug 30, 2001 at 01:17 UTC
|
Whatever web server you're using isn't sending out the appropriate content type (text/html, presumably). You can either configure the webserver to set the content type for whatever extension your file is to text/html, or have the script send out a "content-type: text/html\n\n" line before any html code. | [reply] |
Re: beginner
by jryan (Vicar) on Aug 30, 2001 at 01:28 UTC
|
If you are trying to learn cgi, I recommend getting Indigo Perl. It comes with a built in version of Apache, which you can use to test CGI scripts (make sure that your scripts are in the cgi-bin!). Just dl, install, and run the Perl Console executable to start the web server.
Also, since you are on a windows machine, you should be able to drag-drop perl programs onto the Perl executable. Just go to the bin directory, and drag your .pl file onto perl (a yellow icon with indigo perl). Nice and easy :)
Good luck with learning perl!
| [reply] |
|
|
Thanks jryan,
It seems that the first line "/usr/bin/perl" is not working I need a direct path to the perl.exe (this is not on the server yet).
What do you suggest???
The perl.exe file is in d:\perl\bin directory.
What is the appropriate way to approach this.
Regards,
Nick
| [reply] |
|
|
On windows machines, #!perl is almost always the correct path to put at the top of your scripts.
If you are on a linux box, type: whereis perl. That will tell you the correct path to perl.
| [reply] [d/l] [select] |
|
|
Post your code! Don't be shy!
(Maybe it's something obvious someone will spot at once - e.g. if the first line actually is /usr/bin/perl that's maybe the problem as it wd usually be something like #!/usr/bin/perl)
§ George Sherston
| [reply] [d/l] [select] |