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 7909395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T12:23:36+00:00 2026-06-03T12:23:36+00:00

So I wrote a simple html 1.0 server, and I have some perl scripts

  • 0

So I wrote a simple html 1.0 server, and I have some perl scripts on the server. In particular, I have this script called my histogram, that is an html form with a form action equal another cgi file. Here’s the code:

print "<form action=\"tallyandprint.cgi\" method=\"GET\">";

Now, when I call tallyandprint.cgi, it plots a graph with gnuplot and sends it to the user’s browser (STDOUT is redirected in the html server code, so perl inherets it). Now, I also want to be able to run tallyandprint.cgi from bash, but take a different style of arguments. Right now, I use perl parsing to grab the patterns by parsing the url, and separating the contents between the + symbol (example:?pattern=1+2+3+4 is what the url is).

Thats fine and dandy, but I don’t want my arguments to be written in bash as 1+2+3+4, but rather separated differently. I tried to use perl’s version of isatty(), but since the input is always from the terminal (because the server executes it), I cannot distinguish between whether the input is from bash or from web browser this way.

My next though was to find out if STDOUT is redirected. Since if the webserver runs the cgi, the STDOUT will be redirected to the socket that the user is connected to. If run in bash, the STDOUT should be the normal tty. How can I check this in perl?

  • 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-03T12:23:38+00:00Added an answer on June 3, 2026 at 12:23 pm
    if (-t STDOUT) {
        say "STDOUT is probably not redirected";
    }
    else {
        say "STDOUT is probably redirected";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm doing a simple a simple html site that I wrote which needed some
I wrote a simple Sinatra app that generate an image using rmagick from some
I have a script that links to the server I am hosting (IP can
I have this asp.NET web site that for some odd reason doesn't want to
1: I have a .html file that has some markup with some placeholder tags.
I wrote a simple webpage as follows: <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN
I wrote a simple contact form for a client in Django. However, whenever it
I have simple form with a textarea and a button, and I submit the
I am aware that I can Google HTML Form Validation and would get a
We have some code that must access low level windows XP os calls 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.