caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Michael Leary <leary@nwlink.com>
To: Alain Frisch <frisch@clipper.ens.fr>
Cc: caml <caml-list@inria.fr>
Subject: Re: [Caml-list] OcamlMakefile not working for me...
Date: Mon, 27 Aug 2001 15:10:43 -0700	[thread overview]
Message-ID: <20010827151043.C11197@jean.nwlink.com> (raw)
In-Reply-To: <Pine.GSO.4.04.10108271353220.10757-100000@clipper.ens.fr>; from frisch@clipper.ens.fr on Mon, Aug 27, 2001 at 02:01:48PM +0200

On Mon, Aug 27, 2001 at 02:01:48PM +0200, Alain Frisch wrote:
> This function expects the program to be called with the CGI interface;
> when you call it directly on the command line, the Cgi module can't tell
> what the CGI arguments are and which _HTTP_ method you use.
> 
> (Perl's CGI has something interesting for debugging: when the program is
> called on the command line, the module asks the user for 'name=value'
> bindings on the standard input; maybe this could be an useful feature
> for Cgi)

Here's what I ended up with.  Works from the command line even, and
functions more or less like "errors to browser" in Perl.  In practice, I'd
probably do some matching on 'value', and Do The Right Thing, i.e. maybe
request user input ala CGI.pm, but this at least works.  :)

open Printf;;
open Cgi;;

let value =
	try
		parse_arguments default_config;
		argument_value("foo")
	with
		Not_found -> "key not found";
		| Failure x -> "Failure: " ^ x;;
	
header "text/html";;

printf "<html><body>foo: %s</body></html>" value;;



-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


  reply	other threads:[~2001-08-27 22:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-27  4:39 Michael Leary
2001-08-27  8:16 ` Michael Leary
2001-08-27  9:59   ` Michael Leary
2001-08-27 10:11     ` Michael Leary
2001-08-27 12:01     ` Alain Frisch
2001-08-27 22:10       ` Michael Leary [this message]
2001-08-28  0:39       ` Gerd Stolpmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010827151043.C11197@jean.nwlink.com \
    --to=leary@nwlink.com \
    --cc=caml-list@inria.fr \
    --cc=frisch@clipper.ens.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).