Perl language structure: Difference between revisions

Content deleted Content added
Data types: Fixed grammar
Tags: Manual revert Reverted canned edit summary Mobile edit Mobile app edit Android app edit
revert - it was Perl 5.10; see https://metacpan.org/pod/release/RGARCIA/perl-5.10.0/pod/perl5100delta.pod#say()
Line 28:
The second line in the canonical form includes a semicolon, which is used to separate statements in Perl. With only a single statement in a block or file, a separator is unnecessary, so it can be omitted from the minimal form of the program—or more generally from the final statement in any block or file. The canonical form includes it, because it is common to terminate every statement even when it is unnecessary to do so, as this makes editing easier: code can be added to, or moved away from, the end of a block or file without having to adjust semicolons.
 
Version 5.0110 of Perl introduces a <code>say</code> function that implicitly appends a newline character to its output, making the minimal "Hello World" program even shorter:
 
<syntaxhighlight lang="perl">