in reply to Re: Re: Re: Re: Optimizing away calls to functions defined in eval
in thread Optimizing away calls to functions defined in eval
Things that generate very well are expressable in XML. If you can't express it easilly in static XML, it isn't a good place to generate. Good examples are database schemas - you then generate the perl accessors and also create/alter scripts from one source. Another is lists of static text to pre/append to pages depending on user preferences - like what level of help they require.
The usage in perl would be like $page->print_hints(-hint_level=>$user->setting('hintlevel')); The perl is overly verbose, but you get the idea.<help page="user-settings"> <tip level="novice"> Do not touch anything, the defaults are fine </tip> <tip level="admin"> Changing the starting day of the week will impact reports and time + sheets </tip> </help>
-jackdied
|
|---|