|
From: Wizard <wi...@ne...> - 2002-01-28 23:19:24
|
> Would it be a better programming practice to use subroutines instead of > variables as constants? 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. Although your suggestion would work, I think it's a bit of overkill for the sake of saying that it's "better programming practice". Grant M. |