Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8298377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T15:44:56+00:00 2026-06-08T15:44:56+00:00

My question is regarding cgi. I wondered if I have a Perl script saved

  • 0

My question is regarding cgi. I wondered if I have a Perl script saved as a .cgi file, what is the actual mechanism that lets the server know it’s a Perl script and not something else? I know there is a #!/usr/local/bin/perl at the beginning of the source file but that’s also part of the Perl programing language, so the server has to know it’s a Perl script before it starts execution.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T15:44:58+00:00Added an answer on June 8, 2026 at 3:44 pm

    If the server is configured to recognize the .cgi suffix, then it simply executes the file, probably using one of the exec*() functions.

    On a Unix-like system, if the file is a text file starting with #!, then the system kernel itself will use that line to determine which interpreter to launch to run the file as a script.

    You can write CGI scripts in any interpreted language (Perl, Python, bash, sh, ruby, etc., etc.).

    For that matter, you can use any executable file as a CGI script program. If you compile, say, a C, C++, or Ada program to create an executable file, then install it in an appropriate directory with a .cgi suffix on the file name, the web server can execute it directly. It’s not commonly done, because scripting languages tend to be move convenient for this kind of thing, but the web server doesn’t care what kind of executable file it’s invoking, or how the kernel invokes it.

    (The details are likely to be a bit different on Windows, which usually uses the file extension to determine how to launch an executable.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

simple question regarding HQL(Hibernate query language) so i have user class , that can
I have a question regarding file reading and I am getting frustrated over it
I have a need to upgrade a Perl CGI script where the users must
Question regarding fluent nHibernate table mappings: Apparently I was under the mistaken impression, that
i have a question regarding the AsyncTask class in android, and why it is
I have a question regarding applying a RTRIM on a ASP:Hyperlink statement. The code
A quick question regarding the java.lang.VerifyError exception. Suppose I get an error that looks
I have a question regarding the proper way to modify a php DateTime object.
After asking this question ( XAMPP Mercurial installation on Windows Apache --> HgWebDir.cgi Script
I'm trying to update some existing code that normally runs a Perl script which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.