How to setup D language with Apache httpd cgi?

BoQsc vaidas.boqsc at gmail.com
Wed Jul 31 07:06:36 UTC 2019


On Wednesday, 31 July 2019 at 06:52:46 UTC, 0xEAB wrote:
> On Wednesday, 31 July 2019 at 06:30:03 UTC, BoQsc wrote:
>> This can be solved by using single quotes in the argument 
>> content places
>>>#!/usr/bin/env rdmd
>>>import std.stdio;
>>>void main()
>>>{
>>>    writeln("Content-type: text/html");
>>>    writeln("");
>>>    writeln("<body style='background: green'>CGI D 
>>> Example</body>");
>>>
>>>}
>
> Does the job but is a bad fix.
>
> Use `` quotes for the string literal instead.
> Further info: https://dlang.org/spec/lex.html#wysiwyg
>
>
>  - Elias

I wasn't aware of Wysiwyg Strings, thanks,
seems to work very well.

>#!/usr/bin/env rdmd
>import std.stdio;
>void main()
>{
>    writeln(`Content-type: text/html`);
>    writeln(``);
>    writeln(`<body style="background: lightgreen">CGI D 
> Example</body>`);
>
>}




More information about the Digitalmars-d-learn mailing list