PDA

View Full Version : CGI


file13
07-11-2002, 01:20 PM
anyone done CGI with Ocaml? i've been meaning to get around to it. i have this nifty asian_viking name generator i need to use:

http://www.qlippoth.com/asian_viking.ml

:D

jemfinch
07-11-2002, 02:56 PM
CGI is just an interface. If you've written CGI in any language, you can write it in O'Caml.

Jeremy

file13
07-11-2002, 03:57 PM
no shit sherlock. i've used cgi before.... ;)

i'm asking if anyone has done it WITH Ocaml. there are two different libraries i've seen:

http://sourceforge.net/projects/ocamlnet

http://www.lri.fr/~filliatr/software.en.html

the ocamlnet was a pain to install and it's OOP while the small one is simply functions. just looking for opinions if any.... :)

GnuVince
07-11-2002, 04:31 PM
I would probably use the smaller lib. Be sure to post the code here, right?

file13
07-11-2002, 04:33 PM
sure. if i ever get a chance to sit down and do it.

jemfinch
07-11-2002, 11:14 PM
I still don't see what you need a library for at all.

Jeremy

file13
07-12-2002, 12:06 PM
call me crazy, but i find code reuse a good thing.... ;)

yeah sure you could grab the envorinmental variables yourself and write your own functions, but why when there are prewritten libs?

(not that it matters because i still haven't had a chance to play with them....)

file13
07-12-2002, 07:00 PM
got it working. code is here:

http://www.qlippoth.com/asian_viking.ml

it's pretty straightforward and uses the small cgi from here:

http://www.lri.fr/~filliatr/ftp/ocaml/cgi/

yeah the lib is pretty straight forward. it passes the envirnmnetal values in an association list so you can just use List.assoc to get the input.

other then that the only problem was don't sitck a "\n" in Printf by accident.

i'd stick it up, but i can't install ocaml on our freebsd server and i don't want to give a link to my box at home since it's a dynamic IP you might get accused of webhacking some poor schlub with zone alarm..... :stupid:

but anyways, for future refernece this lib is pretty nifty and to the point. does the conversions for you without a lot of mess. :D

file13
07-12-2002, 07:47 PM
installed ocaml on the server:

http://www.qlippoth.com/cgi-bin/asian_viking.cgi

i am now:

Eyjólfr 'Hung Long Dong' Sakai!

:D