3 * Description: Perl programming language.
5 * Author: Jim Villani, Logistics Management Institute (jvillani@lmi.org)
6 * perl_pod mods by Gregor Purdy (gregor@focusresearch.com)
7 * perl_parens by Josh Zenker (josh.zenker@sig.com)
10 state perl_pod extends Highlight
21 state perl_comment extends Highlight
29 state perl_dquot_string extends Highlight
40 state perl_quot_string extends Highlight
51 state perl_bquot_string extends Highlight
62 state perl_parens extends Highlight
74 state perl extends HighlightEntry
83 /* Ignore escaped quote marks */
94 /* stuff after a -> is a method,
95 * don't bold just because it looks like a keyword
101 /* stuff between a - and a => is a named parameter,
102 * don't bold just because it looks like a keyword
108 /* In cgi files, JavaScript might be embedded, so we need to look out
109 * for the JavaScript comments, because they might contain something
110 * we don't like, like a contraction (don't, won't, etc.)
111 * We won't put them in comment face, because they are not perl
119 /* String constants. */
123 call (perl_dquot_string);
129 call (perl_quot_string);
133 /* Backquoted command string */
137 call (perl_bquot_string);
143 keyword_face (false);
147 /* Keywords. From perl distribution's toke.c
148 abs accept alarm and atan2 bind binmode bless caller chdir chmod
149 chomp chop chown chr chroot close closedir cmp connect continue cos
150 crypt dbmclose dbmopen defined delete die do dump each else elsif
151 endgrent endhostent endnetent endprotoent endpwent endservent eof
152 eq eval exec exists exit exp fcntl fileno flock for foreach fork
153 format formline ge getc getgrent getgrgid getgrnam gethostbyaddr
154 gethostbyname gethostent getlogin getnetbyaddr getnetbyname
155 getnetent getpeername getpgrp getppid getpriority getprotobyname
156 getprotobynumber getprotoent getpwent getpwnam getpwuid getservbyname
157 getservbyport getservent getsockname getsockopt glob gmtime goto
158 grep gt hex if index int ioctl join keys kill last lc lcfirst le
159 length link listen local localtime log lstat lt m map mkdir msgctl
160 msgget msgrcv msgsnd my ne new next no not oct open opendir or ord
161 pack package pipe pop pos print printf prototype push q qq quotemeta
162 qw qx rand read readdir readline readlink readpipe recv redo ref
163 rename require reset return reverse rewinddir rindex rmdir s scalar
164 seek seekdir select semctl semget semop send setgrent sethostent
165 setnetent setpgrp setpriority setprotoent setpwent setservent
166 setsockopt shift shmctl shmget shmread shmwrite shutdown sin sleep
167 socket socketpair sort splice split sprintf sqrt srand stat study
168 sub substr symlink syscall sysopen sysread sysseek system syswrite
169 tell telldir tie tied time times tr truncate uc ucfirst umask undef
170 unless unlink unpack unshift untie until use utime values vec wait
171 waitpid wantarray warn while write x xor y
173 /\b(a(bs|ccept|larm|nd|tan2)|b(in(d|mode)|less)|c(aller|h(dir|mod\
174 |o(mp|p|wn)|r(|oot))|lose(|dir)|mp|o(n(nect|tinue)|s)|rypt)\
175 |d(bm(close|open)|e(fined|lete)|ie|o|ump)|e(ach|ls(e|if)|nd(gr|host|net|proto\
176 |pw|serv)ent|of|q|val|x(ec|i(sts|t)|p))|f(cntl|ileno|lock|or(|each|k\
177 |m(at|line)))|g(e(|t(c|gr(ent|gid|nam)|host(by(addr|name)|ent)|login\
178 |net(by(addr|name)|ent)|p(eername|grp|pid|riority|roto(by(addr|name|number)\
179 |ent)|w(ent|nam|uid))|s(erv(by(name|port)|ent)|ock(name|opt))))|lob|mtime\
180 |oto|rep|t)|hex|i(f|n(t|dex)|octl)|join|k(eys|ill)|l(ast|c(|first)|e(|ngth)\
181 |i(nk|sten)|o(cal(|time)|g)|stat|t)|m|m(ap|kdir|sg(ctl|get|rcv|snd)|y)\
182 |n(e(|w|xt)|o(|t))|o(ct|pen(|dir)|r(|d))|p(ack(|age)|ipe|o(p|s)|r(int(|f)\
183 |ototype)|ush)|q(|q|uotemeta|w|x)|r(and|e(a(d(|dir|lin(e|k)|pipe))|cv\
184 |do|f|name|quire|set|turn|verse|winddir)|index|mdir)|s(|calar|e(e(k|kdir)\
185 |lect|m(ctl|get|op)|nd|t((gr|host|net)ent|p(grp|r(iority|otoent)|went)\
186 |s(ervent|ockopt)))|h(ift|m(ctl|get|read|write)|utdown)|in|leep|o(cke(t|tpair)\
187 |rt)|p(li(ce|t)|rintf)|qrt|rand|t(at|udy)|u(b|bstr)|y(mlink|s(call|open|read\
188 |s(eek|tem)|write)))|t(ell(|dir)|i(e|ed|m(e|es))|r(|uncate))|u(c(|first)\
189 |mask|n(def|l(ess|ink)|pack|shift|ti(e|l))|se|time)|v(alues|ec)|w(a(i(t(|pid))\
190 |ntarray|rn)|hile|rite)|x(|or)|y)\b/ {
194 keyword_face (false);
198 /^=(pod|head1|head2|item|over|back|for|begin|end)\b.*$/ {