I knew that we had a ‘less’ pragmas in Perl 5.8, but it was only yesterday something triggered me to really think about it.
The current version of document on this pragmas is really simple, and the feature itself is not implemented. It seems like there is not much chance for anyone to comment on it. However one thing I noticed is that, it is stated that this pragmas would be used by the compiler to determine certain trade offs base on the user’s wish, and the wording clearly indicates that their intention is that this pragmas would only be used by the compiler, not anyone else, at least base on their current mind set.
Now what I am thinking is that, instead of making it something solely belongs to the compiler, it would be much better if they can actually make it an open interface, so that anyone and everyone wish to contribute modules to Perl, would be able to retrieve those ‘less’ configurations set by users really easily, and adjust the behavior of their modules accordingly.
For example, if I am writing a module abc, and there was this method xyz, I can either make it using more memory to gain speed, or make it using less memory, if speed is not a concern. How do I know the user’s wish? Currently there is no way, but in the future, if the ‘less’ pragmas is open, which means I can retrieve the user settings thru a certain way, then I can go ahead use more memory for speed, if the user does not specify ‘use less memory’, or I should rather use less memory, if the user specifies ‘use less memory’.