Perl 5.44
5.44 5.42
Grammar changes
Tokens
Source: perly.y @ v5.44.0 (e634cc8) / lrama 0.8.0 / 2026-07-13
These diagrams describe a parser grammar, rather than the complete language specification. Lexer state and semantic checks may impose additional restrictions.
Artistic License 1.0
Start wrapper
Unreachable
BNF $accept ::= grammar YYEOF
Used by (0)
References (1)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
GRAMPROG end of file
Midrule action
grammar › $@1
BNF $@1 ::= ε
Used by (1)
References (0)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
BNF grammar ::= GRAMPROG $@1 remember stmtseq
| GRAMEXPR $@2 optexpr
| GRAMBLOCK $@3 block
| GRAMBARESTMT $@4 barestmt
| GRAMFULLSTMT $@5 fullstmt
| GRAMSTMTSEQ $@6 stmtseq
| GRAMSUBSIGNATURE $@7 subsigguts
Used by (1)
References (14)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
GRAMPROG
Midrule action
grammar › $@2
BNF $@2 ::= ε
Used by (1)
References (0)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
Midrule action
grammar › $@3
BNF $@3 ::= ε
Used by (1)
References (0)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
Midrule action
grammar › $@4
BNF $@4 ::= ε
Used by (1)
References (0)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
Midrule action
grammar › $@5
BNF $@5 ::= ε
Used by (1)
References (0)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
Midrule action
grammar › $@6
BNF $@6 ::= ε
Used by (1)
References (0)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
Midrule action
grammar › $@7
BNF $@7 ::= ε
Used by (1)
References (0)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
+ Added in 5.44
grammar › barestmt › bare_statement_block
BNF bare_statement_block ::= block cont
Used by (1)
References (2)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
{ }
+ Added in 5.44
grammar › barestmt › bare_statement_class_declaration
BNF bare_statement_class_declaration ::= KW_CLASS BAREWORD BAREWORD optattrlist PERLY_SEMICOLON
Used by (1)
References (1)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
class bareword bareword ;
Midrule action
grammar › barestmt › bare_statement_class_definition › $@8
BNF $@8 ::= ε
Used by (1)
References (0)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
+ Added in 5.44
grammar › barestmt › bare_statement_class_definition
BNF bare_statement_class_definition ::= KW_CLASS BAREWORD BAREWORD optattrlist PERLY_BRACE_OPEN remember $@8 stmtseq PERLY_BRACE_CLOSE
Used by (1)
References (4)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
class bareword bareword { }
+ Added in 5.44
grammar › barestmt › bare_statement_default
BNF bare_statement_default ::= KW_DEFAULT block
Used by (1)
References (1)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
default { }
+ Added in 5.44
grammar › barestmt › bare_statement_defer
BNF bare_statement_defer ::= KW_DEFER mblock
Used by (1)
References (1)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
defer { }
+ Added in 5.44
grammar › barestmt › bare_statement_expression
BNF bare_statement_expression ::= sideff PERLY_SEMICOLON
Used by (1)
References (1)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
error ;
+ Added in 5.44
grammar › barestmt › bare_statement_field_declaration
BNF bare_statement_field_declaration ::= fielddecl PERLY_SEMICOLON
Used by (1)
References (1)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
field $ bareword ;
Midrule action
grammar › barestmt › bare_statement_for › $@9
BNF $@9 ::= ε
Used by (1)
References (0)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
Midrule action
grammar › barestmt › bare_statement_for › $@10
BNF $@10 ::= ε
Used by (1)
References (0)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
+ Added in 5.44
grammar › barestmt › bare_statement_for
BNF bare_statement_for ::= KW_FOR PERLY_PAREN_OPEN remember mnexpr PERLY_SEMICOLON $@9 texpr PERLY_SEMICOLON $@10 mintro mnexpr PERLY_PAREN_CLOSE mblock
| KW_FOR KW_MY remember my_scalar PERLY_PAREN_OPEN mexpr PERLY_PAREN_CLOSE mblock cont
| KW_FOR KW_MY remember PERLY_PAREN_OPEN my_list_of_itervars PERLY_PAREN_CLOSE PERLY_PAREN_OPEN mexpr PERLY_PAREN_CLOSE mblock cont
| KW_FOR scalar PERLY_PAREN_OPEN remember mexpr PERLY_PAREN_CLOSE mblock cont
| KW_FOR my_refgen remember my_var @11 PERLY_PAREN_OPEN mexpr PERLY_PAREN_CLOSE mblock cont
| KW_FOR REFGEN refgen_topic PERLY_PAREN_OPEN remember mexpr PERLY_PAREN_CLOSE mblock cont
| KW_FOR PERLY_PAREN_OPEN remember mexpr PERLY_PAREN_CLOSE mblock cont
Used by (1)
References (16)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
for ( sub ) { }
Midrule action
grammar › barestmt › bare_statement_for › @11
BNF @11 ::= ε
Used by (1)
References (0)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
+ Added in 5.44
grammar › barestmt › bare_statement_given
BNF bare_statement_given ::= KW_GIVEN PERLY_PAREN_OPEN remember mexpr PERLY_PAREN_CLOSE mblock
Used by (1)
References (3)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
given ( sub ) { }
+ Added in 5.44
grammar › barestmt › bare_statement_if
BNF bare_statement_if ::= KW_IF PERLY_PAREN_OPEN remember mexpr PERLY_PAREN_CLOSE mblock else
Used by (1)
References (4)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
if ( sub ) { }
+ Added in 5.44
grammar › barestmt › bare_statement_null
BNF bare_statement_null ::= PERLY_SEMICOLON
Used by (1)
References (0)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
;
+ Added in 5.44
grammar › barestmt › bare_statement_package_declaration
BNF bare_statement_package_declaration ::= KW_PACKAGE BAREWORD BAREWORD PERLY_SEMICOLON
Used by (1)
References (0)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
package bareword bareword ;
+ Added in 5.44
grammar › barestmt › bare_statement_package_definition
BNF bare_statement_package_definition ::= KW_PACKAGE BAREWORD BAREWORD PERLY_BRACE_OPEN remember $@12 stmtseq PERLY_BRACE_CLOSE
Used by (1)
References (3)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
package bareword bareword { }
Midrule action
grammar › barestmt › bare_statement_phaser › $@13
BNF $@13 ::= ε
Used by (1)
References (0)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
+ Added in 5.44
grammar › barestmt › bare_statement_phaser
BNF bare_statement_phaser ::= PHASER startsub $@13 optsubbody
Used by (1)
References (3)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
PHASER ;
Midrule action
grammar › barestmt › bare_statement_sub_signature › $@14
BNF $@14 ::= ε
Used by (1)
References (0)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
+ Added in 5.44
grammar › barestmt › bare_statement_sub_signature
BNF bare_statement_sub_signature ::= sigsub_or_method_named subname startsub $@14 subattrlist optsigsubbody
Used by (1)
References (6)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
sub bareword ;
Midrule action
grammar › barestmt › bare_statement_sub_traditional › $@15
BNF $@15 ::= ε
Used by (1)
References (0)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
+ Added in 5.44
grammar › barestmt › bare_statement_sub_traditional
BNF bare_statement_sub_traditional ::= KW_SUB_named subname startsub $@15 proto subattrlist optsubbody
Used by (1)
References (6)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
sub bareword ;
Midrule action
grammar › barestmt › bare_statement_try_catch › $@16
BNF $@16 ::= ε
Used by (1)
References (0)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
+ Added in 5.44
grammar › barestmt › bare_statement_try_catch
BNF bare_statement_try_catch ::= KW_TRY mblock KW_CATCH remember catch_paren $@16 mblock finally
Used by (1)
References (5)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
try { } catch { }
+ Added in 5.44
grammar › barestmt › bare_statement_unless
BNF bare_statement_unless ::= KW_UNLESS PERLY_PAREN_OPEN remember mexpr PERLY_PAREN_CLOSE mblock else
Used by (1)
References (4)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
unless ( sub ) { }
+ Added in 5.44
grammar › barestmt › bare_statement_until
BNF bare_statement_until ::= KW_UNTIL PERLY_PAREN_OPEN remember iexpr PERLY_PAREN_CLOSE mintro mblock cont
Used by (1)
References (5)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
until ( sub ) { }
Midrule action
grammar › barestmt › bare_statement_utilize › $@17
BNF $@17 ::= ε
Used by (1)
References (0)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
+ Added in 5.44
grammar › barestmt › bare_statement_utilize
BNF bare_statement_utilize ::= KW_USE_or_NO startsub $@17 BAREWORD BAREWORD optlistexpr PERLY_SEMICOLON
Used by (1)
References (3)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
use / no bareword bareword ;
+ Added in 5.44
grammar › barestmt › bare_statement_when
BNF bare_statement_when ::= KW_WHEN PERLY_PAREN_OPEN remember mexpr PERLY_PAREN_CLOSE mblock
Used by (1)
References (3)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
when ( sub ) { }
+ Added in 5.44
grammar › barestmt › bare_statement_while
BNF bare_statement_while ::= KW_WHILE PERLY_PAREN_OPEN remember texpr PERLY_PAREN_CLOSE mintro mblock cont
Used by (1)
References (5)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
while ( ) { }
+ Added in 5.44
grammar › barestmt › bare_statement_yadayada
BNF bare_statement_yadayada ::= YADAYADA PERLY_SEMICOLON
Used by (1)
References (0)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
YADAYADA ;
grammar › block
BNF block ::= PERLY_BRACE_OPEN remember stmtseq PERLY_BRACE_CLOSE
Used by (9)
References (2)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
{ }
Code example if (1) { print "hello\n"; }
grammar › stmtseq › empty
BNF empty ::= ε
Used by (16)
References (0)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
grammar › remember
BNF remember ::= ε
Used by (15)
References (0)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
grammar › barestmt › bare_statement_defer › mblock
BNF mblock ::= PERLY_BRACE_OPEN mremember stmtseq PERLY_BRACE_CLOSE
Used by (10)
References (2)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
{ }
grammar › barestmt › bare_statement_try_catch › catch_paren
BNF catch_paren ::= empty
| PERLY_PAREN_OPEN $@18 scalar $@19 PERLY_PAREN_CLOSE
Used by (1)
References (4)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
grammar › stmtseq
BNF stmtseq ::= empty
| stmtseq fullstmt
Used by (9)
References (3)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
Code example my @values = (1, 2, 3);
grammar › fullstmt
BNF fullstmt ::= barestmt
| labfullstmt
Used by (2)
References (2)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
PLUGSTMT
grammar › fullstmt › labfullstmt
BNF labfullstmt ::= LABEL barestmt
| LABEL labfullstmt
Used by (2)
References (2)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
LABEL PLUGSTMT
+24 alternatives added in 5.44
grammar › barestmt
BNF barestmt ::= PLUGSTMT
| bare_statement_block
| bare_statement_class_declaration
| bare_statement_class_definition
| bare_statement_default
| bare_statement_defer
| bare_statement_expression
| bare_statement_field_declaration
| bare_statement_for
| bare_statement_format
| bare_statement_given
| bare_statement_if
| bare_statement_null
| bare_statement_package_declaration
| bare_statement_package_definition
| bare_statement_phaser
| bare_statement_sub_signature
| bare_statement_sub_traditional
| bare_statement_try_catch
| bare_statement_unless
| bare_statement_until
| bare_statement_utilize
| bare_statement_when
| bare_statement_while
| bare_statement_yadayada+ alternatives added in 5.44
+ bare_statement_block
+ bare_statement_class_declaration
+ bare_statement_class_definition
+ bare_statement_default
+ bare_statement_defer
+ bare_statement_expression
+ bare_statement_field_declaration
+ bare_statement_for
+ bare_statement_format
+ bare_statement_given
+ bare_statement_if
+ bare_statement_null
+ bare_statement_package_declaration
+ bare_statement_package_definition
+ bare_statement_phaser
+ bare_statement_sub_signature
+ bare_statement_sub_traditional
+ bare_statement_try_catch
+ bare_statement_unless
+ bare_statement_until
+ bare_statement_utilize
+ bare_statement_when
+ bare_statement_while
+ bare_statement_yadayada
Used by (3)
References (24)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
PLUGSTMT
grammar › barestmt › bare_statement_expression › sideff
BNF sideff ::= YYerror
| expr
| expr KW_IF condition
| expr KW_UNLESS condition
| expr KW_WHILE condition
| expr KW_UNTIL iexpr
| expr KW_FOR condition
| expr KW_WHEN condition
Used by (2)
References (3)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
error
grammar › barestmt › bare_statement_if › else
BNF else ::= empty
| KW_ELSE mblock
| KW_ELSIF PERLY_PAREN_OPEN mexpr PERLY_PAREN_CLOSE mblock else
Used by (3)
References (4)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
grammar › barestmt › bare_statement_block › cont
BNF cont ::= empty
| KW_CONTINUE block
Used by (4)
References (2)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
grammar › barestmt › bare_statement_try_catch › finally
BNF finally ::= ε
| KW_FINALLY block
Used by (1)
References (1)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
grammar › barestmt › bare_statement_for › mintro
BNF mintro ::= ε
Used by (3)
References (0)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
grammar › barestmt › bare_statement_for › mnexpr › nexpr
BNF nexpr ::= empty
| sideff
Used by (1)
References (2)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
grammar › barestmt › bare_statement_for › texpr
BNF texpr ::= ε
| expr
Used by (2)
References (1)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
grammar › barestmt › bare_statement_until › iexpr
BNF iexpr ::= expr
Used by (2)
References (1)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
sub
grammar › barestmt › bare_statement_for › mexpr
BNF mexpr ::= expr
Used by (6)
References (1)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
sub
grammar › barestmt › bare_statement_for › mnexpr
BNF mnexpr ::= nexpr
Used by (1)
References (1)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
grammar › barestmt › bare_statement_phaser › startsub
BNF startsub ::= ε
Used by (4)
References (0)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
grammar › optexpr › expr › listexpr › term › anonymous › startanonsub
BNF startanonsub ::= ε
Used by (2)
References (0)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
grammar › barestmt › bare_statement_sub_signature › subname
BNF subname ::= BAREWORD
| PRIVATEREF
Used by (4)
References (0)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
bareword
+1 alternatives added in 5.44
grammar › barestmt › bare_statement_sub_traditional › proto
BNF proto ::= empty
| PROTOTYPE+ alternatives added in 5.44
+ PROTOTYPE
Used by (2)
References (1)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
+1 alternatives added in 5.44
grammar › barestmt › bare_statement_sub_signature › subattrlist
BNF subattrlist ::= empty
| COLONATTR ATTRLIST
| COLONATTR+ alternatives added in 5.44
+ COLONATTR ATTRLIST
Used by (3)
References (1)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
+3 alternatives added in 5.44
grammar › subsigguts › optsiglist › siglist › sigelem › sigslurpelem
BNF sigslurpelem ::= sigslurpsigil sigvar
| sigslurpsigil sigvar ASSIGNOP
| sigslurpsigil sigvar ASSIGNOP term+ alternatives added in 5.44
+ sigslurpsigil sigvar
+ sigslurpsigil sigvar ASSIGNOP
+ sigslurpsigil sigvar ASSIGNOP term
Used by (1)
References (3)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
@
+2 alternatives added in 5.44
grammar › subsigguts › optsiglist › siglist › sigelem › sigscalarelem
BNF sigscalarelem ::= optcolon PERLY_DOLLAR sigvar
| optcolon PERLY_DOLLAR sigvar ASSIGNOP optsigscalardefault+ alternatives added in 5.44
+ optcolon PERLY_DOLLAR sigvar
+ optcolon PERLY_DOLLAR sigvar ASSIGNOP optsigscalardefault
Used by (1)
References (3)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
$
grammar › subsigguts › optsiglist › siglist › sigelem
BNF sigelem ::= sigscalarelem
| sigslurpelem
Used by (1)
References (2)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
$
grammar › subsigguts › optsiglist › siglist
BNF siglist ::= siglist PERLY_COMMA
| siglist PERLY_COMMA sigelem
| sigelem
Used by (2)
References (2)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
$
grammar › subsigguts › optsiglist
BNF optsiglist ::= empty
| siglist
Used by (1)
References (2)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
Midrule action
grammar › subsigguts › $@20
BNF $@20 ::= ε
Used by (1)
References (0)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
grammar › subsigguts
BNF subsigguts ::= $@20 optsiglist
Used by (2)
References (2)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
grammar › barestmt › bare_statement_phaser › optsubbody
BNF optsubbody ::= subbody
| PERLY_SEMICOLON
Used by (2)
References (1)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
;
grammar › barestmt › bare_statement_phaser › optsubbody › subbody
BNF subbody ::= remember PERLY_BRACE_OPEN stmtseq PERLY_BRACE_CLOSE
Used by (2)
References (2)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
{ }
grammar › barestmt › bare_statement_sub_signature › optsigsubbody
BNF optsigsubbody ::= sigsubbody
| PERLY_SEMICOLON
Used by (1)
References (1)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
;
grammar › barestmt › bare_statement_sub_signature › optsigsubbody › sigsubbody
BNF sigsubbody ::= remember optsubsignature PERLY_BRACE_OPEN $@21 stmtseq PERLY_BRACE_CLOSE
Used by (2)
References (4)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
{ }
grammar › optexpr › expr
BNF expr ::= expr ANDOP expr
| expr PLUGIN_LOGICAL_AND_LOW_OP expr
| expr OROP expr
| expr PLUGIN_LOGICAL_OR_LOW_OP expr
| listexpr
Used by (12)
References (2)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
sub
Code example my $value = 1 + 2;
grammar › optexpr › expr › listexpr
BNF listexpr ::= listexpr PERLY_COMMA
| listexpr PERLY_COMMA term
| term
Used by (5)
References (2)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
sub
grammar › optexpr › expr › listexpr › term › listop
BNF listop ::= LSTOP indirob listexpr
| BLKLSTOP block listexpr
| FUNC PERLY_PAREN_OPEN indirob expr PERLY_PAREN_CLOSE
| term ARROW methodname PERLY_PAREN_OPEN optexpr PERLY_PAREN_CLOSE
| term ARROW methodname
| term ARROW PERLY_AMPERSAND subname PERLY_PAREN_OPEN optexpr PERLY_PAREN_CLOSE
| term ARROW PERLY_AMPERSAND subname
| METHCALL0 indirob optlistexpr
| METHCALL indirob PERLY_PAREN_OPEN optexpr PERLY_PAREN_CLOSE
| LSTOP optlistexpr
| FUNC PERLY_PAREN_OPEN optexpr PERLY_PAREN_CLOSE
| FUNC SUBLEXSTART optexpr SUBLEXEND
| LSTOPSUB startanonsub block @22 optlistexpr
Used by (1)
References (11)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
LSTOP
Midrule action
grammar › optexpr › expr › listexpr › term › listop › @22
BNF @22 ::= ε
Used by (1)
References (0)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
grammar › optexpr › expr › listexpr › term › listop › methodname
BNF methodname ::= METHCALL0
| scalar
Used by (1)
References (1)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
METHCALL0
grammar › optexpr › expr › listexpr › term › subscripted
BNF subscripted ::= gelem PERLY_BRACE_OPEN expr PERLY_SEMICOLON PERLY_BRACE_CLOSE
| scalar PERLY_BRACKET_OPEN expr PERLY_BRACKET_CLOSE
| term ARROW PERLY_BRACKET_OPEN expr PERLY_BRACKET_CLOSE
| subscripted PERLY_BRACKET_OPEN expr PERLY_BRACKET_CLOSE
| scalar PERLY_BRACE_OPEN expr PERLY_SEMICOLON PERLY_BRACE_CLOSE
| term ARROW PERLY_BRACE_OPEN expr PERLY_SEMICOLON PERLY_BRACE_CLOSE
| subscripted PERLY_BRACE_OPEN expr PERLY_SEMICOLON PERLY_BRACE_CLOSE
| term ARROW PERLY_PAREN_OPEN PERLY_PAREN_CLOSE
| term ARROW PERLY_PAREN_OPEN expr PERLY_PAREN_CLOSE
| subscripted PERLY_PAREN_OPEN expr PERLY_PAREN_CLOSE
| subscripted PERLY_PAREN_OPEN PERLY_PAREN_CLOSE
| PERLY_PAREN_OPEN expr PERLY_PAREN_CLOSE PERLY_BRACKET_OPEN expr PERLY_BRACKET_CLOSE
| QWLIST PERLY_BRACKET_OPEN expr PERLY_BRACKET_CLOSE
| PERLY_PAREN_OPEN PERLY_PAREN_CLOSE PERLY_BRACKET_OPEN expr PERLY_BRACKET_CLOSE
Used by (2)
References (5)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
sub ARROW ( )
grammar › optexpr › expr › listexpr › term › termbinop
BNF termbinop ::= term PLUGIN_HIGH_OP term
| term ASSIGNOP term
| term PLUGIN_ASSIGN_OP term
| term POWOP term
| term PLUGIN_POW_OP term
| term MULOP term
| term PLUGIN_MUL_OP term
| term ADDOP term
| term PLUGIN_ADD_OP term
| term SHIFTOP term
| termrelop
| termeqop
| term BITANDOP term
| term BITOROP term
| term DOTDOT term
| term ANDAND term
| term PLUGIN_LOGICAL_AND_OP term
| term OROR term
| term PLUGIN_LOGICAL_OR_OP term
| term DORDOR term
| term MATCHOP term
| term PLUGIN_LOW_OP term
Used by (1)
References (3)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
sub PLUGIN_HIGH_OP sub
grammar › optexpr › expr › listexpr › term › termbinop › termrelop
BNF termrelop ::= relopchain
| term NCRELOP term
| termrelop NCRELOP
| termrelop CHRELOP
| term PLUGIN_REL_OP term
Used by (2)
References (3)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
sub NCRELOP sub
grammar › optexpr › expr › listexpr › term › termbinop › termrelop › relopchain
BNF relopchain ::= term CHRELOP term
| relopchain CHRELOP term
Used by (2)
References (2)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
sub CHRELOP sub
grammar › optexpr › expr › listexpr › term › termbinop › termeqop
BNF termeqop ::= eqopchain
| term NCEQOP term
| termeqop NCEQOP
| termeqop CHEQOP
Used by (2)
References (3)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
sub NCEQOP sub
grammar › optexpr › expr › listexpr › term › termbinop › termeqop › eqopchain
BNF eqopchain ::= term CHEQOP term
| eqopchain CHEQOP term
Used by (2)
References (2)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
sub CHEQOP sub
grammar › optexpr › expr › listexpr › term › termunop
BNF termunop ::= PERLY_MINUS term
| PERLY_PLUS term
| PERLY_EXCLAMATION_MARK term
| PERLY_TILDE term
| term POSTINC
| term POSTDEC
| term POSTJOIN
| PREINC term
| PREDEC term
Used by (1)
References (1)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
- sub
+3 alternatives added in 5.44
grammar › optexpr › expr › listexpr › term › anonymous
BNF anonymous ::= PERLY_BRACKET_OPEN optexpr PERLY_BRACKET_CLOSE
| HASHBRACK optexpr PERLY_SEMICOLON PERLY_BRACE_CLOSE
| KW_SUB_anon startanonsub proto subattrlist subbody
| KW_SUB_anon startanonsub proto subattrlist
| KW_SUB_anon_sig startanonsub subattrlist sigsubbody
| KW_SUB_anon_sig startanonsub subattrlist
| KW_METHOD_anon startanonmethod subattrlist sigsubbody
| KW_METHOD_anon startanonmethod subattrlist+ alternatives added in 5.44
+ KW_SUB_anon startanonsub proto subattrlist
+ KW_SUB_anon_sig startanonsub subattrlist
+ KW_METHOD_anon startanonmethod subattrlist
Used by (1)
References (7)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
sub
grammar › optexpr › expr › listexpr › term › termdo
BNF termdo ::= KW_DO term
| KW_DO block
Used by (1)
References (2)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
do sub
grammar › optexpr › expr › listexpr › term
BNF term ::= termbinop
| termunop
| anonymous
| termdo
| term PERLY_QUESTION_MARK term PERLY_COLON term
| REFGEN term
| myattrterm
| KW_LOCAL term
| PERLY_PAREN_OPEN expr PERLY_PAREN_CLOSE
| QWLIST
| PERLY_PAREN_OPEN PERLY_PAREN_CLOSE
| scalar
| star
| hsh
| ary
| arylen
| subscripted
| sliceme PERLY_BRACKET_OPEN expr PERLY_BRACKET_CLOSE
| kvslice PERLY_BRACKET_OPEN expr PERLY_BRACKET_CLOSE
| sliceme PERLY_BRACE_OPEN expr PERLY_SEMICOLON PERLY_BRACE_CLOSE
| kvslice PERLY_BRACE_OPEN expr PERLY_SEMICOLON PERLY_BRACE_CLOSE
| THING
| amper
| amper PERLY_PAREN_OPEN PERLY_PAREN_CLOSE
| amper PERLY_PAREN_OPEN expr PERLY_PAREN_CLOSE
| NOAMP subname optlistexpr
| term ARROW PERLY_DOLLAR PERLY_STAR
| term ARROW PERLY_SNAIL PERLY_STAR
| term ARROW PERLY_PERCENT_SIGN PERLY_STAR
| term ARROW PERLY_AMPERSAND PERLY_STAR
| term ARROW PERLY_STAR PERLY_STAR
| LOOPEX
| LOOPEX term
| NOTOP listexpr
| UNIOP
| UNIOP block
| UNIOP term
| KW_REQUIRE
| KW_REQUIRE term
| UNIOPSUB
| UNIOPSUB term
| FUNC0
| FUNC0 PERLY_PAREN_OPEN PERLY_PAREN_CLOSE
| FUNC0OP
| FUNC0OP PERLY_PAREN_OPEN PERLY_PAREN_CLOSE
| FUNC0SUB
| FUNC1 PERLY_PAREN_OPEN PERLY_PAREN_CLOSE
| FUNC1 PERLY_PAREN_OPEN expr PERLY_PAREN_CLOSE
| PMFUNC @23 SUBLEXSTART listexpr optrepl SUBLEXEND
| BAREWORD
| listop
| PLUGEXPR
Used by (19)
References (23)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
sub
Midrule action
grammar › optexpr › expr › listexpr › term › @23
BNF @23 ::= ε
Used by (1)
References (0)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
+2 alternatives added in 5.44
grammar › optexpr › expr › listexpr › term › myattrterm
BNF myattrterm ::= KW_MY myterm attrlist
| KW_MY myterm
| KW_MY REFGEN myterm attrlist
| KW_MY REFGEN term+ alternatives added in 5.44
+ KW_MY myterm attrlist
+ KW_MY REFGEN myterm attrlist
Used by (1)
References (3)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
my REFGEN sub
grammar › optexpr › expr › listexpr › term › myattrterm › myterm
BNF myterm ::= PERLY_PAREN_OPEN expr PERLY_PAREN_CLOSE
| PERLY_PAREN_OPEN PERLY_PAREN_CLOSE
| scalar
| hsh
| ary
Used by (1)
References (4)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
( )
+2 alternatives added in 5.44
grammar › barestmt › bare_statement_field_declaration › fielddecl
BNF fielddecl ::= KW_FIELD fieldvar optattrlist
| KW_FIELD fieldvar optattrlist ASSIGNOP $@24 term+ alternatives added in 5.44
+ KW_FIELD fieldvar optattrlist
+ KW_FIELD fieldvar optattrlist ASSIGNOP term
Used by (1)
References (4)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
field $ bareword
grammar › barestmt › bare_statement_utilize › optlistexpr
BNF optlistexpr ::= empty
| listexpr
Used by (3)
References (2)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
grammar › optexpr
BNF optexpr ::= empty
| expr
Used by (3)
References (2)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
grammar › optexpr › expr › listexpr › term › optrepl
BNF optrepl ::= empty
| PERLY_SLASH expr
Used by (1)
References (2)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
ε
grammar › barestmt › bare_statement_for › my_scalar
BNF my_scalar ::= scalar
Used by (1)
References (1)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
$ bareword
+ Added in 5.44
grammar › barestmt › bare_statement_for › my_list_of_itervars › list_of_itervars
BNF list_of_itervars ::= list_of_itervars PERLY_COMMA
| list_of_itervars PERLY_COMMA scalar
| list_of_itervars PERLY_COMMA REFGEN my_var
| scalar
| REFGEN my_var
Used by (2)
References (3)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
$ bareword
+ Added in 5.44
grammar › barestmt › bare_statement_for › my_list_of_itervars
BNF my_list_of_itervars ::= list_of_itervars
Used by (1)
References (1)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
$ bareword
grammar › barestmt › bare_statement_for › my_var
BNF my_var ::= scalar
| ary
| hsh
Used by (3)
References (3)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
$ bareword
grammar › barestmt › bare_statement_for › refgen_topic
BNF refgen_topic ::= my_var
| amper
Used by (1)
References (2)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
$ bareword
grammar › barestmt › bare_statement_for › my_refgen
BNF my_refgen ::= KW_MY REFGEN
| REFGEN KW_MY
Used by (1)
References (0)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
my REFGEN
grammar › barestmt › bare_statement_for › refgen_topic › amper
BNF amper ::= PERLY_AMPERSAND indirob
Used by (2)
References (1)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
& bareword
grammar › barestmt › bare_statement_for › scalar
BNF scalar ::= PERLY_DOLLAR indirob
Used by (11)
References (1)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
$ bareword
grammar › barestmt › bare_statement_for › my_var › ary
BNF ary ::= PERLY_SNAIL indirob
Used by (5)
References (1)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
@ bareword
grammar › barestmt › bare_statement_for › my_var › hsh
BNF hsh ::= PERLY_PERCENT_SIGN indirob
Used by (5)
References (1)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
% bareword
grammar › optexpr › expr › listexpr › term › arylen
BNF arylen ::= DOLSHARP indirob
| term ARROW DOLSHARP PERLY_STAR
Used by (1)
References (2)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
DOLSHARP bareword
grammar › optexpr › expr › listexpr › term › star
BNF star ::= PERLY_STAR indirob
Used by (2)
References (1)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
* bareword
grammar › optexpr › expr › listexpr › term › sliceme
BNF sliceme ::= ary
| term ARROW PERLY_SNAIL
Used by (1)
References (2)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
@ bareword
grammar › optexpr › expr › listexpr › term › kvslice
BNF kvslice ::= hsh
| term ARROW PERLY_PERCENT_SIGN
Used by (1)
References (2)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
% bareword
grammar › optexpr › expr › listexpr › term › subscripted › gelem
BNF gelem ::= star
| term ARROW PERLY_STAR
Used by (1)
References (2)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
* bareword
grammar › barestmt › bare_statement_for › scalar › indirob
BNF indirob ::= BAREWORD
| scalar
| block
| PRIVATEREF
Used by (7)
References (2)
Shortest derivation This is a token sequence derived from the grammar. It may require lexer context or semantic checks to be valid code.
bareword