Perl CGI  «Prev  Next»

Lesson 1

Perl and CGI

This module discusses techniques for overcoming some of the inherent limitations of the HTTP protocol. In particular, you will learn:
  1. How to use the state-machine model to keep track of users
  2. How to pass data from page to page using hidden fields
  3. How to use Perl variables in an HTML file
  4. How to use HTTP cookies

In the process, you will build and experiment with the first part of our class project, the Guestbook program.
When you are finished with this module you will have a good understanding of the state-machine model and how to use it to make your programs more interactive for your users.

SEMrush Software

Techniques available for overcoming some of the Inherent Limitations of the HTTP protocol

  1. Use a Persistent Connection:
    • Enable HTTP keep-alive to maintain a single TCP connection for multiple HTTP requests.
    • This reduces the overhead of establishing new connections for each request.
  2. Use Pipelining:
    • Send multiple HTTP requests in a single TCP connection before waiting for responses.
    • This improves latency and throughput by avoiding the round-trip time for each request.
  3. Use Chunked Encoding:
    • Break the response body into smaller chunks and send them progressively.
    • This allows the client to start processing the response as soon as the first chunk is received.
  4. Use Compression:
    • Compress the HTTP request and response bodies using techniques like GZIP or DEFLATE.
    • This reduces the amount of data transferred and improves the overall performance.
  5. Use a Proxy Server:
    • Place a proxy server between the client and the server.
    • The proxy server can cache frequently requested resources, reducing the load on the origin server.
  6. Use a Load Balancer:
    • Distribute incoming HTTP requests across multiple servers to handle high traffic volumes.
    • This improves scalability and ensures that no single server becomes overloaded.
  7. Use a Content Delivery Network (CDN):
    • Store static content, such as images and CSS files, on a CDN.
    • This reduces the load on the origin server and improves the performance for users in different geographical locations.
  8. Use Server-Sent Events (SSE):
    • Enable the server to push real-time updates to the client without the need for the client to poll the server repeatedly.
    • This is useful for applications that require real-time data updates, such as chat applications.
  9. Use WebSockets:
    • Establish a persistent, bidirectional communication channel between the client and the server.
    • This allows for real-time, bi-directional communication, enabling use cases like online gaming, video conferencing, and collaborative editing.
  10. Use HTTP/2:
    • Adopt the HTTP/2 protocol, which offers significant improvements over HTTP/1.1, including multiplexing, header compression, and server push
    • HTTP/2 reduces latency and improves performance for modern web applications.


DNA and RNA

Each of us has observed physical and other similarities among members of human families. While some of these similarities are due to the common environment these families share, others are inherited, that is, passed on from parent to child as part of the reproductive process. Traits such as eye color and blood type and certain diseases such as red-green color blindness and Huntington's disease are among those known to be heritable. In humans and all other nonviral organisms, heritable traits are encoded and passed on in the form of deoxyribonucleic acid, or DNA for short. The DNA encoding of a single trait is often referred to as a gene. Most human DNA does not encode traits that distinguish one human from another but rather traits we have in common with all other members of the human family. We do share more than 99.9% of our DNA.
DNA consists of long chains of molecules of the modified sugar deoxyribose, to which are joined the nucleotides adenine, cytosine, guanine, and thymine. The scientific significance of these names is minimal. Guanine, for example, is named after the bird guano from which it was first isolated, and we will normally refer to these nucleotides or bases by the letters A, C, G, and T. For computational purposes, a strand of DNA can be represented by a string of As, Cs, Gs, and Ts.

SEMrush Software