cgi = CGI.new causes the script to hang

  • Thread starter Gavri Savio Fernandez
  • Start date
G

Gavri Savio Fernandez

hi,
i don't know what i'm doing wrong, but the following code outputs 'before' and never outputs 'after'. it seems to be stuck in CGI.new.
does anyone know what might be the problem here?
----
require 'cgi'
$stdout.sync = true
puts 'before'
cgi = CGI.new
puts 'after'
----

thank you

Gavri Savio Fernandez
___________________________________________
What if everything is an illusion and nothing exists? In that case, I definitely overpaid for my carpet. - Woody Allen
 
T

ts

G> i don't know what i'm doing wrong, but the following code outputs
G> 'before' and never outputs 'after'. it seems to be stuck in CGI.new.
G> does anyone know what might be the problem here?

It's trying to read name=value pairs on standard input.

Use Control-D (^D) on un*x or ^Z (???) on windows, to close the input.


Guy Decoux
 
A

Ara.T.Howard

Date: Mon, 1 Dec 2003 02:54:37 +0900 From: Gavri Savio Fernandez
<[email protected]> Newsgroups: comp.lang.ruby Subject: cgi = CGI.new
causes the script to hang

hi, i don't know what i'm doing wrong, but the following code outputs
'before' and never outputs 'after'. it seems to be stuck in CGI.new. does
anyone know what might be the problem here? ---- require 'cgi' $stdout.sync
= true puts 'before' cgi = CGI.new puts 'after' ----

thank you

Gavri Savio Fernandez
___________________________________________
What if everything is an illusion and nothing exists? In that case, I
definitely overpaid for my carpet. - Woody Allen

guy already mentioned it's reading from standard in. one thing that's useful
for testing is:

~ > cat input
key=value
foo=bar

~ > foo.cgi < input


this should work on windows, *nix, whatever.



-a
--

ATTN: please update your address books with address below!

===============================================================================
| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE :: 303.497.6469
| ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328
| STP :: http://www.ngdc.noaa.gov/stp/
| NGDC :: http://www.ngdc.noaa.gov/
| NESDIS :: http://www.nesdis.noaa.gov/
| NOAA :: http://www.noaa.gov/
| US DOC :: http://www.commerce.gov/
|
| The difference between art and science is that science is what we
| understand well enough to explain to a computer.
| Art is everything else.
| -- Donald Knuth, "Discover"
|
| /bin/sh -c 'for l in ruby perl;do $l -e "print \"\x3a\x2d\x29\x0a\"";done'
===============================================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top