index.html 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>CodeMirror: Perl mode</title>
  6. <link rel="stylesheet" href="../../lib/codemirror.css">
  7. <script src="../../lib/codemirror.js"></script>
  8. <script src="perl.js"></script>
  9. <link rel="stylesheet" href="../../doc/docs.css">
  10. <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
  11. </head>
  12. <body>
  13. <h1>CodeMirror: Perl mode</h1>
  14. <div><textarea id="code" name="code">
  15. #!/usr/bin/perl
  16. use Something qw(func1 func2);
  17. # strings
  18. my $s1 = qq'single line';
  19. our $s2 = q(multi-
  20. line);
  21. =item Something
  22. Example.
  23. =cut
  24. my $html=<<'HTML'
  25. <html>
  26. <title>hi!</title>
  27. </html>
  28. HTML
  29. print "first,".join(',', 'second', qq~third~);
  30. if($s1 =~ m[(?<!\s)(l.ne)\z]o) {
  31. $h->{$1}=$$.' predefined variables';
  32. $s2 =~ s/\-line//ox;
  33. $s1 =~ s[
  34. line ]
  35. [
  36. block
  37. ]ox;
  38. }
  39. 1; # numbers and comments
  40. __END__
  41. something...
  42. </textarea></div>
  43. <script>
  44. var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
  45. lineNumbers: true
  46. });
  47. </script>
  48. <p><strong>MIME types defined:</strong> <code>text/x-perl</code>.</p>
  49. </body>
  50. </html>