How to embed HTML in Perl.

Source: Internet
Author: User

Recently, in csdn CGI, we have seen centuries (burning the sun) Users asking how to embed HTML in Perl. This is a common problem in Perl web development, hope to help you.

Question

I now have an HTML webpage code. I want to change it to a Perl program. If I just add "#!.. /Perl/bin/Perl "and change the file suffix. CGI. The error message "You don't have permission to access/test/index appears. CGI on this server. ". In other words, how does Perl with a suffix of. cgi contain HTML code? Thank you.

Answer: Sub html_html
{
Print "Content-Type: text/html/n ";
Print <EOF;
# Output html
EOF
Exit;
}
Question Thank you, ceocio.
After the image is added, the image "resource/top.gif" cannot be displayed. The image path is absolutely correct, for example, resource/top.gif.
Answer:

Use the relative path. It is best to create an installation file setup. cgi

In your file:
Require "setup. cgi ";

Then, call:

The setup. cgi file contains this line:
$ GIF = 'HTTP: // your url/resource'; # The URL path of the image. Note that it is a single quotation mark instead of a double quotation mark.

In this way, you can use the relative path.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.