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>