I have started to move my Hugs CGI scripts into GHC.
Here is an example hugs cgi script:

-----helloCGI.lhs-----
#!/usr/local/bin/runhugs
> main=putStr "content-type: text/html\n\nhello world\n"
-----------------------

This is literate Haskell so it should be completely acceptable to any
Haskell compiler/interpreter and Hugs does accept it.
But, GHC rejects the #!/usr/local/bin/runhugs at the top of the script
with the message:

        hello.lhs:1:1: parse error on input: "#!/"

My instinct is to replace the unlit binary with something like:

---unlit.pl---
#!/usr/bin/perl
while (<>) {
    print substr ($_,1) if $_=~/^>/;
}
--------------

Is this wrong? 

-Alex-

___________________________________________________________________
S. Alexander Jacobson                   i2x Media  
1-212-697-0184 voice                    1-212-697-1427 fax


Reply via email to