Rob,

On Dec 29, 2004, at 1:07 PM, Rob Kinyon wrote:
I think I am going to look at Config::ApacheFormat and see if I can't
hack in multi-line support. That will answer my questions in the end
anyway.

You're going to want to look at doing something like heredocs. Maybe, it would look something like:

<Foo foo1>
    Directive
multiline
text
here
EndDirective

    SomeOtherDirective With Some Values
</Foo>

Actually I was thinking they would work best as <blocks> and not directives. This would allow for more free-form text inside the block and not force the introduction of an 'End<directive name>' token.


This means you'll want to look at the while-loop labelled LINE:,
especially the do-while loop with the comment "# accumulate a full
line, dealing with line-continuation". Adding a new directive called
"multi_line" would probably be best, along the same lines as
hash_directives or duplicate_directives, where you specify which
directives have this multi_line property set for them. That way,
people who don't want it don't get it, it's backwards-compatible, and
it's self-documenting as to which directives break the Apache standard
expectations.

I already have something hacked together and working with <blocks> right now, and I have introduced a 'valid_multi_line_blocks' option to turn it on for specific blocks only. And this:


<Registry MyApp>
<Container DBI>
dsn dbi:mysql:test
username test
password ****
<Service connect>
my $c = shift;
DBI->connect($c->get('dsn'), $c->get('username'), $c->get('password'));
</Service>
</Container>
</Registry>


is parsing succusfully.

I am actually going to email Sam to see if he is interested in it before I start cleaning up the code.

Steve


Rob


Steve

Rob


On Wed, 29 Dec 2004 10:36:08 -0500, Stevan Little <[EMAIL PROTECTED]> wrote:

On Dec 28, 2004, at 8:47 PM, Terrence Brannon wrote:
I think so. But why not name your subrefs and put them in a module
and
refer to them in a single clean line of config code?

Hmmmm, Thats a good thought.

Steve


_______________________________________________ sw-design mailing list [email protected] http://metaperl.com/cgi-bin/mailman/listinfo/sw-design


_______________________________________________ sw-design mailing list [email protected] http://metaperl.com/cgi-bin/mailman/listinfo/sw-design



_______________________________________________
sw-design mailing list
[email protected]
http://metaperl.com/cgi-bin/mailman/listinfo/sw-design


_______________________________________________ sw-design mailing list [email protected] http://metaperl.com/cgi-bin/mailman/listinfo/sw-design



_______________________________________________
sw-design mailing list
[email protected]
http://metaperl.com/cgi-bin/mailman/listinfo/sw-design

Reply via email to