-
Notifications
You must be signed in to change notification settings - Fork 601
Perl Protocol Declaration
Nicolas R edited this page Jul 9, 2020
·
12 revisions
All parsed code must begin with use vX; It is a directive to the interpreter which tells it how to parse the following code.
The following pragmas are required by perl 7 before any code is allowed to be parsed. Comments and whitespace are permissible. -x applies.
use v5;
use v7;
# This is a placeholder. Open for bikeshed.
use current; # Tell the parser to use the major of the current binary. The following is allowed but won't technically work on perl 5:
use v7;
sub foo ($bar) {
...;
}
use v5;
package foo;
sub bar ($@) {
...;
}
1;At this time (5 and 7) it really only affects $^H, %^H, and $^WARNINGS but this may change at a future date.