Single-line and multiline comment syntax in Perl

Source: Internet
Author: User
Tags comments

This article mainly introduces the single-line annotation and multiline annotation syntax in Perl, and also explains the single-line annotation and multiline annotation syntax of other common programming languages, and the friends who need it can refer to the following

As with most other programming languages, Single-line comments in Perl also begin with a #, such as:

The code is as follows:

#print "hello,world!";

But multiline annotations, different languages have different ways of commenting, such as:

Java,c/c++:

The code is as follows:

/*

* Comment on several lines

* Comment on several lines

* Comment on several lines

*/

Python:

The code is as follows:

"""

With three double quotes, multiline comment

With three double quotes, multiline comment

With three double quotes, multiline comment

"""

'''

With three single quotes, multiple lines of comments

With three single quotes, multiple lines of comments

With three single quotes, multiple lines of comments

'''

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 annotations are:

The code is as follows:

=

Multi-line Comment content

Multi-line Comment content

Multi-line Comment content

=cut

Description: The first equal sign must be followed by a character!

For example:

The code is as follows:

#! C:perlbinperl-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.