- Re: .cgi and .pl: I don't think it makes a difference.
- Some hosts require Perl scripts to be placed in the cgi-bin, and others do not, it all depends.
- I don't believe plain old Perl can be imbedded into an HTML page, but you CAN use HTML in a Perl print command
Here's an example:
<BLOCKQUOTE><font size="1" face="Verdana, Arial">code/font><HR><pre>
print "<html><head>";
print "<title>This Page Has Been Created By Perl!</title>";
print "</head><body>Hello World</body></html>";
[/code]
Also, don't forget that you cannot use a quotation mark inside the print command...unless you use the print qq command instead.
------------------ Chris Bowyer – chris@mycoding.com MyCoding.com: Visit for Launch Notification! DomainMailings.com: Who Says All The Good Ones Are Taken? MovieForums.com: Talk About Your Favorite Flicks!
[This message has been edited by TWTCommish (edited August 10, 2000).]
ok i was just starting on perl and doing some basic scripts but the tutorial doesnt cover some things could someone plz anwser them for me.
1. Ok basically all i am doing is using print to say 1 line of text but what do i do? like should i use embed code on html into a page, run it from my ftp or shell? or just goto the address i put it on
2. Whats the difference between .cgi and .pl does it make a difference if i dont put them in the cgi-bin?
it doesn't matter what you name your perl scripts on a unix server, its the first line that says how to execute the file. .cgi is just what most people do.
On an NT server you need to name it .pl or whatever extension is associated with perl.
And no they don't have to be in a cgi-bin but because scripts ofter require different permissions than the other files its generally a good idea to keep them all in 1 place.
As to how to print 1 line of text, you could execute the program from the shell. To do it from a webpage you'd either load the script in your browser or, if it takes variables (like most do) access it using an HTML Form.
If you are printing a lot of text you can use a delimiter...
print <<SomeHTML;
<html>
some html
you can also use "
</html>
SomeHTML
You can use the backslash to escape special characters like \@ and \"
You can embed perl into html if you have modperl and ssi (i think). Visit my website to see an example of perl embedded in a webpage. http://www.incomplete.co.uk *under constrcution*
Bookmarks