T
Tore Aursand
Hi!
I need to develop a templating system. I _cannot_ use on of the
templating systems found on CPAN as this utility will be used on
"proprietary" (and already existing) template files. So - please don't
tell me to go to CPAN; I already know of it, and I know the templating
systems found there. Thanks.
The problem is lists. And lists in lists (in lists...). I've decided to
have the data structure for my lists like this:
$VAR1 = {
'__ROOT__' => {
'children' => [
{
'name' => 'WEEK_LIST',
'columns' => [ 'NR' ],
'values' => [
[ '1' ],
[ '2' ]
],
'children' => [
{
'name' => 'DAY_LIST',
'columns' => [ 'DAY' ],
'values' => [
[ '1' ],
[ '2' ],
[ '3' ],
[ '4' ],
[ '5' ],
[ '6' ],
[ '7' ],
]
},
{
'name' => 'DAY_LIST',
'columns' => [ 'DAY' ],
'values' => [
[ '8' ],
[ '9' ],
[ '10' ],
[ '11' ],
[ '12' ],
[ '13' ],
[ '14' ],
]
}
]
}
]
}
}
This is from Data:umper, though I had to reformat it a bit. I guess you
all get the point. The template for this data looks like this (shortened):
<%% WEEK_LIST BEGIN %%>
<%% NR %%>:<%% DAY_LIST BEGIN %%> <%% DAY %%><%% DAY_LIST END %%>
<%% WEEK_LIST END %%>
Thus - in the end - the following output should be created:
1: 1 2 3 4 5 6 7
2: 8 9 10 11 12 13 14
Now. I have absolutely _no_ idea on how to create this list (and take
height for the fact that there can be unlimited nested lists). Anyone
feel like they have the guts to try?
Thanks!
I need to develop a templating system. I _cannot_ use on of the
templating systems found on CPAN as this utility will be used on
"proprietary" (and already existing) template files. So - please don't
tell me to go to CPAN; I already know of it, and I know the templating
systems found there. Thanks.
The problem is lists. And lists in lists (in lists...). I've decided to
have the data structure for my lists like this:
$VAR1 = {
'__ROOT__' => {
'children' => [
{
'name' => 'WEEK_LIST',
'columns' => [ 'NR' ],
'values' => [
[ '1' ],
[ '2' ]
],
'children' => [
{
'name' => 'DAY_LIST',
'columns' => [ 'DAY' ],
'values' => [
[ '1' ],
[ '2' ],
[ '3' ],
[ '4' ],
[ '5' ],
[ '6' ],
[ '7' ],
]
},
{
'name' => 'DAY_LIST',
'columns' => [ 'DAY' ],
'values' => [
[ '8' ],
[ '9' ],
[ '10' ],
[ '11' ],
[ '12' ],
[ '13' ],
[ '14' ],
]
}
]
}
]
}
}
This is from Data:umper, though I had to reformat it a bit. I guess you
all get the point. The template for this data looks like this (shortened):
<%% WEEK_LIST BEGIN %%>
<%% NR %%>:<%% DAY_LIST BEGIN %%> <%% DAY %%><%% DAY_LIST END %%>
<%% WEEK_LIST END %%>
Thus - in the end - the following output should be created:
1: 1 2 3 4 5 6 7
2: 8 9 10 11 12 13 14
Now. I have absolutely _no_ idea on how to create this list (and take
height for the fact that there can be unlimited nested lists). Anyone
feel like they have the guts to try?
Thanks!