The image verification code you entered is incorrect.

And Jeff said, "Let there be merging"

In order to support per-directory options for mod_perl6, I had to implement configuration merging, which I've been avoiding like the plague. But it's done, and it looks like this (some code omitted for brevity):

sub server_merge(%base, %new)
{
    my %merged;

    # merge handlers -- never inherit
    for @server_phases.map({$_ ~ '_handler'}) -> $h {
        %merged{$h} = %new{$h};
    }

    return %merged;
}

sub dir_merge(%base, %new)
{
    my %merged;

    # merge options -- inherit only if not set
    %merged = {};
    for %valid_options.keys -> $k {
        %merged{$k} = %new.exists($k) ??
            %new{$k} !! %base{$k};
    }

    # merge handlers -- never inherit
    for @dir_phases.map({$_ ~ '_handler'}) -> $h {
        %merged{$h} = %new{$h};
    }

    return %merged;
}

I still think it's cool that this is written in Perl 6. mod_parrot handles all the hard stuff behind the scenes so mod_perl6 code can stay lean and mean!

Reply

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Captcha Image: you will need to recognize the text in it.
Please type in the letters/numbers that are shown in the image above.