+our $perlop_text = <<'END'; # c&p from man perlop
+ left terms and list operators (leftward)
+ left ->
+ nonassoc ++ --
+ right **
+ right ! ~ \ and unary + and -
+ left =~ !~
+ left * / % x
+ left + - .
+ left << >>
+ nonassoc named unary operators
+ nonassoc < > <= >= lt gt le ge
+ nonassoc == != <=> eq ne cmp ~~
+ left &
+ left | ^
+ left &&
+ left || //
+ nonassoc .. ...
+ right ?:
+ right = += -= *= etc. goto last next redo dump
+ left , =>
+ nonassoc list operators (rightward)
+ right not
+ left and
+ left or xor
+
+ **= += *= &= &.= <<= &&=
+ -= /= |= |.= >>= ||=
+ .= %= ^= ^.= //=
+ x=
+END
+
+our $perlop_re;
+
+sub prep_perlop () {
+ my @ops;
+ foreach (split /\n/, $perlop_text) {
+ next unless m{\S};
+ s{\s+$}{};
+ s{^\s+}{};
+ s{^(?: left | right | nonassoc ) \s+}{}x;
+ next if m{^terms and list operators};
+ next if m{^named unary};
+ next if m{^list operators};
+ s{ and unary.*}{};
+ s{ etc\. }{ };
+ foreach my $op (split /\s+/) {
+ next unless length $op;
+ next if $op =~ m{^\w+$};
+ $op =~ s/\W/\\$&/g;
+ push @ops, $op;
+ }
+ }
+ $perlop_re = '(?: '.(join ' | ', @ops).' )';
+ $perlop_re = qr{$perlop_re}x;
+ #print STDERR "$perlop_re\n";
+}
+
+prep_perlop();
+