# MDSN: http://msdn.microsoft.com/library/en-us/iisref/html/psdk/asp/a +pro9tkj.asp use strict; use warnings; use Win32::OLE qw(in); # Connect to IIS on the Local Machine with ADSI... my $iis_web_object = Win32::OLE->GetObject("IIS://LocalHost/W3SVC") or die "Can't access IIS on the local machine\n"; my ($perl_path) = $^X =~ /(.*)\\[^\\]+$/; my $iis_verbs = ((Win32::GetOSVersion)[1] == 5) ? 'GET,HEAD,POST' : 'P +UT,DELETE'; foreach my $path (in $iis_web_object->GetDataPaths("ScriptMaps", 0)) { my $node = Win32::OLE->GetObject($path); print "Setting $path...\n"; my $str_maps = $node->{ScriptMaps}; my %script_maps; foreach (in @$str_maps) { my ($ext, $exe, $script, $verbs) = split /,/, $_, 4; $script_maps{$ext} = { exe => $exe, script => $script, verbs=> $ve +rbs} } $script_maps{'.pl'} = $script_maps{'.pm'} = $script_maps{'.cgi'} = { exe => $^X.' "%s" %s', script=> 1, verbs=> $iis_verbs }; $script_maps{'.plx'} = { exe => $perl_path."\\perlIS.dll", script=> 1, verbs=> $iis_verbs +}; my $new_maps = []; foreach (sort keys %script_maps) { push @$new_maps, join ',', $_ , $script_maps{$_}->{exe} , $script_maps{$_}->{script} , $script_maps{$_}->{verbs} } $node->{ScriptMaps} = $new_maps; $node->SetInfo(); } undef $iis_web_object;

In reply to Here is a fixed version -- just watch for line wraps :-| by Anonymous Monk
in thread Fix ActiveState Script Maps (IIS) by $code or die

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.