Reputation: 13706
What does the colon mean in the following Perl program?
MAIN: {
print "Hello\n";
}
Upvotes: 7
Views: 5079
Reputation: 129383
The colon is a required separator of a label from the following block.
From perlsyn:
The LABEL is optional, and if present, consists of an identifier followed by a colon
Upvotes: 11
Reputation: 42094
It separates a label (MAIN
) from a block (the stuff between curly braces).
In Perl, a label is always suffixed with a colon, so you might argue the colon is part of the label.
Upvotes: 17