Single-line comment and multi-line comment syntax in Perl

Source: Internet
Author: User

Single-line comment and multi-line comment syntax in Perl

This article mainly introduces single-line and multi-line annotation syntaxes in Perl. It also describes the single-line and multi-line annotation syntaxes in other common programming languages. For more information, see

Like most other programming languages, single-line comments in Perl start with #, for example:

The Code is as follows:

# Print "Hello, World! ";

However, for multi-line annotations, different languages have different annotation methods, such:

Java, C/C ++:

The Code is as follows:

/*

* Comment several lines

* Comment several lines

* Comment several lines

*/

Python:

The Code is as follows:

"""

Use three double quotes and comment on multiple rows

Use three double quotes and comment on multiple rows

Use three double quotes and comment on multiple rows

"""

'''

Comment with three single quotes and multiple lines

Comment with three single quotes and multiple lines

Comment with three single quotes and multiple lines

'''

Ruby:

The Code is as follows:

= Begin

This is a comment.

This is a comment, too.

This is a comment, too.

= End

Shell:

The Code is as follows:

# This is a comment.

# This is a comment, too.

# This is a comment, too.

Perl: multiline comments:

The Code is as follows:

=

Multi-line comment content

Multi-line comment content

Multi-line comment content

= Cut

Note: The first equals sign must be followed by one character!

For example:

The Code is as follows:

#! C: \ Perl \ bin \ perl-w

Use strict;

Use warnings;

Use String: Util ': all ';

Use 5.016;

= My $ element = "abc ";

Printf "<% S>

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.