- 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 "<title>This Page Has Been Created By Perl!</title>";
print "</head><body>Hello World</body></html>";
Also, don't forget that you cannot use a quotation mark inside the print command...unless you use the print qq command instead.
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.