As with most other programming languages, Single-line comments in Perl also begin with a #, such as:
Copy Code code as follows:
But multiline annotations, different languages have different ways of commenting, such as:
java,c/c++:
Copy Code code as follows:
/*
* Comment on several lines
* Comment on several lines
* Comment on several lines
*/
Python:
Copy Code code 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:
Copy Code code as follows:
=begin
This is a comment.
This is a comment, too.
This is a comment, too.
=end
Shell:
Copy Code code as follows:
# This is a comment.
# This is a comment, too.
# This is a comment, too.
Perl: Multiline annotations are:
Copy Code code 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:
Copy Code code as follows:
#! C:\Perl\bin\perl-w
Use strict;
Use warnings;
Use String::util ': all ';
Use 5.016;
=my $element = "abc";
printf "<%s>\n", Trim ($element);
printf "<%s>\n", Trim ($element, right => 0);
printf "<%s>\n", Trim ($element, left => 0);
=cut