Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Is there a difference .pl and .cgi extensions?

( #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!
  • 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
  • Outside of code tags, you may need to use entities for some characters:
            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?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others chilling in the Monastery: (13)
    As of 2014-09-19 13:24 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      How do you remember the number of days in each month?











      Results (138 votes), past polls