[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

order of #include 'xxx'


I just solved my last problem, the sorting of news entries in a table.

I have used:

#include 'news/*.dat'

But I could not figure out on what it depends which order the files
were included. It was even so that I had two identical #include
statements on different WML-pages and the result was different.

So I looked at the source of wml_backend/p1_ipp/ipp.src which was not
fun because I doesnīt have used perl anytime before....

I added a line after line 241:

241:            @ls = grep { /^$pattern$/  && eval $test } readdir(DIR);
242:            @ls = sort @ls;
243:            closedir DIR;

This results in an lexically sort-order. So one can depend on a
specific order of includes.

I donīt know if that has any side effects, or if it is usefull for


Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com