|
From: Olivier D. <dr...@sh...> - 2002-01-28 23:35:30
|
On Mon, Jan 28, 2002 at 06:17:27PM -0800, Wizard wrote: > In an ideal world, it might. However, there is much more overhead associated > with creating and calling a subroutine then using a simple scalar. When you > create a subroutine, Perl needs to create a new namespace, stack, etc., and > then when called, there is quite a bit of code that needs to be executed in > order to pass all of the information (even if there isn't any explicitly > passed) to the subroutine. Would the "use constant CONSTANTNAME => VALUE" be more efficient? As efficient as scalars, arrays or hash? > Although your suggestion would work, I think it's > a bit of overkill for the sake of saying that it's "better programming > practice". Maybe I'm pushing it too far, but I thought the aim of this project was to provide better quality (in delivering a service, in security and as a coding model) In my opinion, allowing what should be constants to be modified isn't a very secure practice. Would you do the same in C? -Oli -- +----------------------------------------------+ | Olivier Dragon dr...@sh... | | Software Engineering II, McMaster University | +----------------------------------------------+ |