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>