/usr/share/source-highlight/perl.lang is in libsource-highlight-common 3.1.8-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | preproc = "import"
# these might be unreadable but I don't know how else to do that...
(keyword,regexp,keyword) =
`(s)(\{(?:\\\}|[^}])*\}\{(?:\\\}|[^}])*\})([ixsmogce]*)`
(keyword,regexp,keyword) =
`(s)(\((?:\\\)|[^)])*\)\((?:\\\)|[^)])*\))([ixsmogce]*)`
(keyword,regexp,keyword) =
`(s)(\[(?:\\\]|[^\]])*\]\[(?:\\\]|[^\]])*\])([ixsmogce]*)`
(keyword,regexp,keyword) = `(s)(<.*><.*>)([ixsmogce]*)`
(keyword,string) = `(q(?:q?))(\{(?:\\\}|[^}])*\})`
(keyword,string) = `(q(?:q?))(\((?:\\\)|[^)])*\))`
(keyword,string) = `(q(?:q?))(\[(?:\\\]|[^\]])*\])`
(keyword,string) = `(q(?:q?))(<.*>)`
(keyword,string,string) = `(q(?:q?))([^[:alnum:][:blank:]])(.*\2)`
# the last (lookahead) expression is used to deal with # used
# as a delimiter.
# otherwise, with a line such as
# s#foo\###; # my comment
# the # of the comment would be match as the closing delimiter
(keyword,regexp,regexp,keyword) =
`(s)([^[:alnum:][:blank:]])(.*\2.*\2)([ixsmogce]*(?=[[:blank:]]*(?:\)|;)))`
# this is to deal with cases where the delimiters for the first and the
# second part are not the same (and spaces are allowed between the first
# closing and the second opening)
(keyword,regexp,regexp,regexp,regexp,keyword) =
`(s)([^[:alnum:][:blank:]])(.*\2[[:blank:]]*)([^[:alnum:][:blank:]])(.*\4)([ixsmogce]*(?=[[:blank:]]*(?:\)|;)))`
include "script_comment.lang"
include "number.lang"
# this won't work if # has something (non blank) before
vardef comment_in_exp = '[[:blank:]]+#.*'
vardef var_in_exp = '\$([[:word:]]+|\{[[:word:]]+\})'
# this is to highlight correctly regular expressions
# (and don't mix them with { } code blocks
environment keyword = '(m|qr)(?=\{)' begin
environment regexp = '\{' begin
comment = $comment_in_exp
variable = $var_in_exp
regexp = '\\\{|\\\}'
regexp = "}" exitall
end
end
# repeat for other non alpha numerical chars
environment keyword = '(m|qr)(?=#)' begin
environment regexp = '#' begin
comment = $comment_in_exp
variable = $var_in_exp
regexp = '\\#'
regexp = "#" exitall
end
end
environment keyword = '(m|qr)(?=\|)' begin
environment regexp = '\|' begin
comment = $comment_in_exp
variable = $var_in_exp
regexp = '\\\|'
regexp = "\|" exitall
end
end
environment keyword = '(m|qr)(?=@)' begin
environment regexp = '@' begin
comment = $comment_in_exp
variable = $var_in_exp
regexp = '\\@'
regexp = "@" exitall
end
end
environment keyword = '(m|qr)(?=<)' begin
environment regexp = '<' begin
comment = $comment_in_exp
variable = $var_in_exp
regexp = '\\<|\\>'
regexp = ">" exitall
end
end
environment keyword = '(m|qr)(?=\[)' begin
environment regexp = '\[' begin
comment = $comment_in_exp
variable = $var_in_exp
regexp = '\\]'
regexp = "]" exitall
end
end
environment keyword = '(m|qr)(?=\\)' begin
environment regexp = '\\' begin
comment = $comment_in_exp
variable = $var_in_exp
regexp = '\\\\'
regexp = "\\" exitall
end
end
environment keyword = '(m|qr)(?=/)' begin
environment regexp = '/' begin
comment = $comment_in_exp
variable = $var_in_exp
regexp = '\\/'
regexp = "/" exitall
end
end
string delim "\"" "\"" escape "\\"
string delim "'" "'" escape "\\"
string delim "<" ">"
#string = '[[:word:]]*/[^\n]*/[[:word:]]*'
string = '/[^\n]*/'
keyword = "chomp|chop|chr|crypt|hex|i|index|lc|lcfirst|length|oct|ord|pack|q|qq|reverse|rindex|sprintf|substr|tr|uc|ucfirst|m|s|g|qw|abs|atan2|cos|exp|hex|int|log|oct|rand|sin|sqrt|srand|my|local|our|delete|each|exists|keys|values|pack|read|syscall|sysread|syswrite|unpack|vec|undef|unless|return|length|grep|sort|caller|continue|dump|eval|exit|goto|last|next|redo|sub|wantarray|pop|push|shift|splice|unshift|split|switch|join|defined|foreach|last|chop|chomp|bless|dbmclose|dbmopen|ref|tie|tied|untie|while|next|map|eq|die|cmp|lc|uc|and|do|if|else|elsif|for|use|require|package|import|chdir|chmod|chown|chroot|fcntl|glob|ioctl|link|lstat|mkdir|open|opendir|readlink|rename|rmdir|stat|symlink|umask|unlink|utime|binmode|close|closedir|dbmclose|dbmopen|die|eof|fileno|flock|format|getc|print|printf|read|readdir|rewinddir|seek|seekdir|select|syscall|sysread|sysseek|syswrite|tell|telldir|truncate|warn|write|alarm|exec|fork|getpgrp|getppid|getpriority|kill|pipe|qx|setpgrp|setpriority|sleep|system|times|x|wait|waitpid"
comment delim '^\=(?:head1|head2|item)' '\=cut' multiline
variable = '(?:\$[#]?|@|%)[/[:word:]]+'
include "symbols.lang"
cbracket = "{|}"
include "function.lang"
|