in reply to Re: Best practices with globals and subroutine arguments
in thread Best practices with globals and subroutine arguments

I'd probably use "global" variables. I wouldn't say on Perlmonks ...

JavaFan, today you have

Experience:  	11072
Level:	Prior (17)
Writeups: 	2074 
You obviously know about scoping, about the best practices and when its ok to break them; you're an expert.

How often do you use globals to avoid de-referencing references, and does that simplify things considerably?

  • Comment on Re^2: Best practices with globals and subroutine arguments

Replies are listed 'Best First'.
Re^3: Best practices with globals and subroutine arguments
by JavaFan (Canon) on Jun 07, 2010 at 10:04 UTC
    The OP indicates the variables are not modified inside the subroutines. For the POV of the subroutine, the variables might as well be constants.

    How often do you use "global" constants, and does that simplify your code instead of passing them around in each subroutine call?

    You obviously know about scoping, about the best practices and when its ok to break them; you're an expert.
    I find this a bit insulting for the OP. It suggests the OP is an idiot, or at least needs to program with his training wheels on. I do not with to make such assumptions.