•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Perl section within the Software Development category of DaniWeb, a massive community of 455,972 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,808 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Perl advertiser: Programming Forums
Views: 835 | Replies: 3
![]() |
•
•
Join Date: Nov 2007
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
'Ello, I'm Andrew & I have a very big problem. I'm learning Perl & I'm having problem with my first simple code. Every time I go to look @ the page it just comes up excluding the HTML tags. Here's the code 'firstscript.cgi':
& it's URL
I think it's
1) My Firefox Browser
2) The fact that I don't see the path to the shebang statement anywhere
#! /usr/bin/perl print "Content-type:text/html\n\n"; print "<html><head><title>My First Script</title></head>\n\n"; print "<body>\n"; print "<p>Hello world!</p>\n"; print "</body></html>";
I think it's
1) My Firefox Browser
2) The fact that I don't see the path to the shebang statement anywhere
Last edited by happygeek : Nov 27th, 2007 at 7:28 pm. Reason: url snipped - popup ads
•
•
Join Date: Sep 2007
Location: North Bay Ontario
Posts: 176
Reputation:
Rep Power: 2
Solved Threads: 20
I'm going to go out on a limb and ask: are you viewing your page by just loading it into your browser?
Do you realize that with CGI scripts you have to access them through a web server? You would have to point your browser to '127.0.0.1/cgi-bin/your_script.pl' or wherever you have your web server configured to hold executables.
Do you have a web server running? This may seem like an obvious question, but if this is your first CGI script perhaps you may have missed that bit of crucial information.
Also please answer for us:
What OS are you running? Even though the shebang line indicates some flavour of Linux or UNIX, it doesn't matter in a Windows environment.
What exactly do you see when you view the page? I'm sorry but I won't be visiting the URL you posted.
Do you realize that with CGI scripts you have to access them through a web server? You would have to point your browser to '127.0.0.1/cgi-bin/your_script.pl' or wherever you have your web server configured to hold executables.
Do you have a web server running? This may seem like an obvious question, but if this is your first CGI script perhaps you may have missed that bit of crucial information.
Also please answer for us:
What OS are you running? Even though the shebang line indicates some flavour of Linux or UNIX, it doesn't matter in a Windows environment.
What exactly do you see when you view the page? I'm sorry but I won't be visiting the URL you posted.
Last edited by trudge : Nov 26th, 2007 at 3:24 pm.
Amer Neely - Web Mechanic
"Others make web sites. We make web sites work!"
"Others make web sites. We make web sites work!"
•
•
Join Date: Oct 2007
Posts: 302
Reputation:
Rep Power: 2
Solved Threads: 29
If you see "Hello world!" in the browser when you pull up this page, then it's working fine. This isn't so much of a cgi script as a perl script that prints out html.
You won't see the #! perl line or any of the print statements. When you view source, you'll just see what you've printed.
I think you've got it right, just, maybe, unclear on what you're looking for
Best wishes,
, Mike
You won't see the #! perl line or any of the print statements. When you view source, you'll just see what you've printed.
I think you've got it right, just, maybe, unclear on what you're looking for
Best wishes,
, Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
Having trouble passing cert exams? Check out How To Pass Any Computer Certification Test!
------------------------------------------------------------------------
Having trouble passing cert exams? Check out How To Pass Any Computer Certification Test!
![]() |
•
•
•
•
•
•
•
•
DaniWeb Perl Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Testing for the last record (VB.NET)
- how can i edit/change a line in a file? (Shell Scripting)
- Cannot modify header information.Headers already sent (PHP)
- How to get http headers? (Python)
- help with shell script padding files with spaces (Shell Scripting)
- Forcing a script to load in Safari -- help needed (JavaScript / DHTML / AJAX)
- Batch Script - Error 7901??? (Windows NT / 2000 / XP / 2003)
- Bash script prob (Kernels and Modules)
- Systra Icons (Visual Basic 4 / 5 / 6)
Other Threads in the Perl Forum
- Previous Thread: Couple o' questions
- Next Thread: PROCESS CHECKING PROBLEM using PERL


Linear Mode