A tumblelog CMS built on AJAX, PHP and MySQL.

perl.php 7.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <?php
  2. /*************************************************************************************
  3. * perl.php
  4. * --------
  5. * Author: Andreas Gohr (andi@splitbrain.org), Ben Keen (ben.keen@gmail.com)
  6. * Copyright: (c) 2004 Andreas Gohr, Ben Keen (http://www.benjaminkeen.org/), Nigel McNie (http://qbnz.com/highlighter/)
  7. * Release Version: 1.0.7.21
  8. * Date Started: 2004/08/20
  9. *
  10. * Perl language file for GeSHi.
  11. *
  12. * CHANGES
  13. * -------
  14. * 2008/02/15 (1.003)
  15. * - Fixed SF#1891630 with placebo patch
  16. * 2006/01/05 (1.0.2)
  17. * - Used hardescape feature for ' strings (Cliff Stanford)
  18. * 2004/11/27 (1.0.1)
  19. * - Added support for multiple object splitters
  20. * 2004/08/20 (1.0.0)
  21. * - First Release
  22. *
  23. * TODO (updated 2004/11/27)
  24. * -------------------------
  25. * * LABEL:
  26. * * string comparison operators
  27. *
  28. *************************************************************************************
  29. *
  30. * This file is part of GeSHi.
  31. *
  32. * GeSHi is free software; you can redistribute it and/or modify
  33. * it under the terms of the GNU General Public License as published by
  34. * the Free Software Foundation; either version 2 of the License, or
  35. * (at your option) any later version.
  36. *
  37. * GeSHi is distributed in the hope that it will be useful,
  38. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  39. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  40. * GNU General Public License for more details.
  41. *
  42. * You should have received a copy of the GNU General Public License
  43. * along with GeSHi; if not, write to the Free Software
  44. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  45. *
  46. ************************************************************************************/
  47. $language_data = array(
  48. 'LANG_NAME' => 'Perl',
  49. 'COMMENT_SINGLE' => array(1 => '#'),
  50. 'COMMENT_MULTI' => array(
  51. '=back' => '=cut',
  52. '=head' => '=cut',
  53. '=item' => '=cut',
  54. '=over' => '=cut',
  55. '=begin' => '=cut',
  56. '=end' => '=cut',
  57. '=for' => '=cut',
  58. '=encoding' => '=cut',
  59. '=pod' => '=cut'
  60. ),
  61. 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
  62. 'QUOTEMARKS' => array('"'),
  63. 'HARDQUOTE' => array("'", "'"), // An optional 2-element array defining the beginning and end of a hard-quoted string
  64. 'HARDESCAPE' => array('\\\'', "\\\\"), // Things that must still be escaped inside a hard-quoted string
  65. // If HARDQUOTE is defined, HARDESCAPE must be defined
  66. // This will not work unless the first character of each element is either in the
  67. // QUOTEMARKS array or is the ESCAPE_CHAR
  68. 'ESCAPE_CHAR' => '\\',
  69. 'KEYWORDS' => array(
  70. 1 => array(
  71. 'case', 'do', 'else', 'elsif', 'for', 'if', 'then', 'until', 'while', 'foreach', 'my',
  72. 'or', 'and', 'unless', 'next', 'last', 'redo', 'not', 'our',
  73. 'reset', 'continue','and', 'cmp', 'ne'
  74. ),
  75. 2 => array(
  76. 'use', 'sub', 'new', '__END__', '__DATA__', '__DIE__', '__WARN__', 'BEGIN',
  77. 'STDIN', 'STDOUT', 'STDERR'
  78. ),
  79. 3 => array(
  80. 'abs', 'accept', 'alarm', 'atan2', 'bind', 'binmode', 'bless',
  81. 'caller', 'chdir', 'chmod', 'chomp', 'chop', 'chown', 'chr',
  82. 'chroot', 'close', 'closedir', 'connect', 'continue', 'cos',
  83. 'crypt', 'dbmclose', 'dbmopen', 'defined', 'delete', 'die',
  84. 'dump', 'each', 'endgrent', 'endhostent', 'endnetent', 'endprotoent',
  85. 'endpwent', 'endservent', 'eof', 'eval', 'exec', 'exists', 'exit',
  86. 'exp', 'fcntl', 'fileno', 'flock', 'fork', 'format', 'formline',
  87. 'getc', 'getgrent', 'getgrgid', 'getgrnam', 'gethostbyaddr',
  88. 'gethostbyname', 'gethostent', 'getlogin', 'getnetbyaddr', 'getnetbyname',
  89. 'getnetent', 'getpeername', 'getpgrp', 'getppid', 'getpriority',
  90. 'getprotobyname', 'getprotobynumber', 'getprotoent', 'getpwent',
  91. 'getpwnam', 'getpwuid', 'getservbyname', 'getservbyport', 'getservent',
  92. 'getsockname', 'getsockopt', 'glob', 'gmtime', 'goto', 'grep',
  93. 'hex', 'import', 'index', 'int', 'ioctl', 'join', 'keys', 'kill',
  94. 'last', 'lc', 'lcfirst', 'length', 'link', 'listen', 'local',
  95. 'localtime', 'log', 'lstat', 'm', 'map', 'mkdir', 'msgctl', 'msgget',
  96. 'msgrcv', 'msgsnd', 'my', 'next', 'no', 'oct', 'open', 'opendir',
  97. 'ord', 'our', 'pack', 'package', 'pipe', 'pop', 'pos', 'print',
  98. 'printf', 'prototype', 'push', 'qq', 'qr', 'quotemeta', 'qw',
  99. 'qx', 'q', 'rand', 'read', 'readdir', 'readline', 'readlink', 'readpipe',
  100. 'recv', 'redo', 'ref', 'rename', 'require', 'return',
  101. 'reverse', 'rewinddir', 'rindex', 'rmdir', 's', 'scalar', 'seek',
  102. 'seekdir', 'select', 'semctl', 'semget', 'semop', 'send', 'setgrent',
  103. 'sethostent', 'setnetent', 'setpgrp', 'setpriority', 'setprotoent',
  104. 'setpwent', 'setservent', 'setsockopt', 'shift', 'shmctl', 'shmget',
  105. 'shmread', 'shmwrite', 'shutdown', 'sin', 'sleep', 'socket', 'socketpair',
  106. 'sort', 'splice', 'split', 'sprintf', 'sqrt', 'srand', 'stat',
  107. 'study', 'substr', 'symlink', 'syscall', 'sysopen', 'sysread',
  108. 'sysseek', 'system', 'syswrite', 'tell', 'telldir', 'tie', 'tied',
  109. 'time', 'times', 'tr', 'truncate', 'uc', 'ucfirst', 'umask', 'undef',
  110. 'unlink', 'unpack', 'unshift', 'untie', 'utime', 'values',
  111. 'vec', 'wait', 'waitpid', 'wantarray', 'warn', 'write', 'y'
  112. )
  113. ),
  114. 'SYMBOLS' => array(
  115. '(', ')', '[', ']', '!', '@', '%', '&', '*', '|', '/', '<', '>'
  116. ),
  117. 'CASE_SENSITIVE' => array(
  118. GESHI_COMMENTS => true,
  119. 1 => true,
  120. 2 => true,
  121. 3 => true,
  122. ),
  123. 'STYLES' => array(
  124. 'KEYWORDS' => array(
  125. 1 => 'color: #b1b100;',
  126. 2 => 'color: #000000; font-weight: bold;',
  127. 3 => 'color: #000066;'
  128. ),
  129. 'COMMENTS' => array(
  130. 1 => 'color: #808080; font-style: italic;',
  131. 'MULTI' => 'color: #808080; font-style: italic;'
  132. ),
  133. 'ESCAPE_CHAR' => array(
  134. 0 => 'color: #000099; font-weight: bold;'
  135. ),
  136. 'BRACKETS' => array(
  137. 0 => 'color: #66cc66;'
  138. ),
  139. 'STRINGS' => array(
  140. 0 => 'color: #ff0000;'
  141. ),
  142. 'NUMBERS' => array(
  143. 0 => 'color: #cc66cc;'
  144. ),
  145. 'METHODS' => array(
  146. 1 => 'color: #006600;',
  147. 2 => 'color: #006600;'
  148. ),
  149. 'SYMBOLS' => array(
  150. 0 => 'color: #66cc66;'
  151. ),
  152. 'REGEXPS' => array(
  153. 0 => 'color: #0000ff;',
  154. 4 => 'color: #009999;',
  155. ),
  156. 'SCRIPT' => array(
  157. )
  158. ),
  159. 'URLS' => array(
  160. 3 => 'http://perldoc.perl.org/functions/{FNAME}.html'
  161. ),
  162. 'OOLANG' => true,
  163. 'OBJECT_SPLITTERS' => array(
  164. 1 => '-&gt;',
  165. 2 => '::'
  166. ),
  167. 'REGEXPS' => array(
  168. 0 => '[\\$%@]+[a-zA-Z_][a-zA-Z0-9_]*',
  169. 4 => '&lt;[a-zA-Z_][a-zA-Z0-9_]*&gt;',
  170. ),
  171. 'STRICT_MODE_APPLIES' => GESHI_NEVER,
  172. 'SCRIPT_DELIMITERS' => array(
  173. ),
  174. 'HIGHLIGHT_STRICT_BLOCK' => array(
  175. )
  176. );