PERL / Appcmd : Add a mapping element that contains spaces and quotes.

How to encode encoded characters without escaping them ? ^_^

When you try to add a module mapping for perl, it is supposed to be configured like this in IIS :

Request Path : *.pl

Executable : C:Perlinperl.exe « %s » %s

This declaration looks like this in IIS config files (web.config or machine.config) :

<handlers>

<add name="Perl" path="*.pl" verb="GET,HEAD,POST" modules="CgiModule" scriptProcessor="E:Perl64Perl64inperl.exe &quot;%s&quot; %s" />

</handlers>

The double-quotes that surrounds %s are encoded with XML encoding.

But when you use appcmd command to declare this module mapping, it is a bit more tricky, because you cannot use the special character &. Furthermore, the presence of spaces into the « scriptProcessor » attribute force you to surround the whole expression with double-quotes…

So, this is the appcmd command :

appcmd.exe set config /section:handlers /"+[name='Perl',paverb='GET,HEAD,POST',modules='CgiModule',scriptProcessor='E:Perl64Perl64inperl.exe %u0022%s%u0022 %s']"

 

 

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *