You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
1.5 KiB

2 months ago
  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>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
  9. <div id=nav>
  10. <a href="https://codemirror.net/5"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png" alt=""></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/codemirror5">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>