index.html 1.5 KB

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