Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Is there a difference .pl and .cgi extensions?

by Anonymous Monk
on Jun 19, 2000 at 19:22 UTC ( #18806=categorized question: print w/replies, xml ) Need Help??
Contributed by Anonymous Monk on Jun 19, 2000 at 19:22 UTC
Q&A  > CGI programming

Answer: Is there a difference .pl and .cgi extensions?
contributed by cleen

these are just extentions, which can be configured on the web server itself. You could do a .hiImaFreak and as long as its defined as executable in the httpd configuration it will run.

Answer: Is there a difference .pl and .cgi extensions?
contributed by merlyn

Not really. Both are unneeded extensions on Unix, that drive me and many other experts nuts. You don't call cat as cat.c! A user should not need to know the implementation language to invoke a program.

Additionally, when used as part of a URL, they give away the implementation language to random users out on the net--a major security hole.

So if your webserver or O/S needs an "extension" to determine that it's a CGI script or a Perl script, please don't use it for anything other than a toy. Real web servers don't need or use those.

Answer: Is there a difference .pl and .cgi extensions?
contributed by tenatious

It's convention only. Kinda like when a M$Word document is named icky.doc. People like to use .pl for perl libraries, which may be required and reused. Naming a script cool.cgi makes it easy to identify cgi scripts, and allows security conscious system administrators to take proper precautions since they can be world executable.

Please (register and) log in if you wish to add an answer

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others browsing the Monastery: (5)
    As of 2020-08-08 04:12 GMT
    Find Nodes?
      Voting Booth?
      Which rocket would you take to Mars?

      Results (51 votes). Check out past polls.