I was just trying to come up with a solution for this but it is very tricky due to how the parser works.
At the time when the include file is parsed the value of the variable inside the include tag will not be available. That only becomes available when the template perl code is evaluated.
I tried a dirty solution but that failed too as the random_file function I used is also not compiled until later on and so I ended up with:
Error: Can't load included file: 'e:/apache1/cgi-bin/lsql/admin/templates/default/MyClass::random_file'. Reason: No such file or directory
As you can see it was trying to load a file with the name of the function rather than the returned value.
Unfortunately I see not easy solution to this :(
At the time when the include file is parsed the value of the variable inside the include tag will not be available. That only becomes available when the template perl code is evaluated.
I tried a dirty solution but that failed too as the random_file function I used is also not compiled until later on and so I ended up with:
Error: Can't load included file: 'e:/apache1/cgi-bin/lsql/admin/templates/default/MyClass::random_file'. Reason: No such file or directory
As you can see it was trying to load a file with the name of the function rather than the returned value.
Unfortunately I see not easy solution to this :(