in reply to Re: Global variables
in thread Global variables
What's the point you are trying to make here? This issue has nothing to do with global variables, and your only defense here is to not use named subroutines.Well, I'm trying to have fun and learn something ;). Moreover, I was discussing about the opportunity to use named subroutines instead of global variables (I linked this thread in my OP as a start), so I suppose this has to do with global variables.
If you want to use a subroutine you should use a reference to an anonymous function.I'm not able to contextualise this within the discussion. The whole point of using subroutines instead of plain variables is - ehr - not using plain variables. If I have to use anonymous functions, I'm probably obliged to use a variable to carry the reference.
My consideration was about using functions instead of global variables, and I do agree with you about the fact that the compiler will croak if we try to call them without using parentheses - something along the lines of use constant. On the other side, this would make it difficult (probably not impossible, but I'm no expert here) to use them as variables instead of constants (which is why you probably say that you can't always easily leave the parenthesis off I suppose).
Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf
|
|---|