{
  "id": "02",
  "content": [
    {
      "type": "heading",
      "text": "Hello, CGI!"
    },
    {
      "type": "text",
      "html": "A minimal CGI script must print the HTTP header, a blank line, then content."
    },
    {
      "type": "text",
      "html": "<pre><code>#!/usr/bin/env perl\nuse strict; use warnings;\nprint \"Content-Type: text/html\\n\\n\";\nprint \"&lt;h1&gt;Hello from Perl/CGI&lt;/h1&gt;\\n\";\n</code></pre>"
    },
    {
      "type": "text",
      "html": "Save as <code>hello.cgi</code>, make executable (<code>chmod 755 hello.cgi</code>), and place in your server\u2019s <code>cgi-bin</code>."
    }
  ],
  "quiz": {
    "questions": [
      {
        "id": "q1",
        "type": "single",
        "text": "What must a CGI script print before HTML?",
        "options": [
          {
            "id": "a",
            "text": "HTTP Content-Type header + blank line"
          },
          {
            "id": "b",
            "text": "DOCTYPE only"
          },
          {
            "id": "c",
            "text": "Nothing"
          }
        ],
        "correct": [
          "a"
        ]
      },
      {
        "id": "q2",
        "type": "single",
        "text": "Which permission is required for running a CGI script on Unix?",
        "options": [
          {
            "id": "a",
            "text": "Executable (e.g., 755)"
          },
          {
            "id": "b",
            "text": "Write only"
          },
          {
            "id": "c",
            "text": "Sticky bit"
          }
        ],
        "correct": [
          "a"
        ]
      }
    ]
  }
}