Anyone know what $::{varname} does ?

Peter Edwards peter at dragonstaff.com
Thu Oct 18 04:55:40 PDT 2007


>> It is the same as $main::varname yes. I'd guess that it was done to
>> naïvely get rid of the errors you'd get with "use strict" without having
>> to potentially refactor the code to use lexically scoped variables.
>
>Strange, the code make liberal use of "my" and has an extensive list of
>global variables specified through "use vars" so it would seem that the
>programmer knew what they were doing with regards strictness.

Perhaps they inherited the code and had to tidy it up?
I can't see why else you'd have a combination of 'use var' globals and
inline ones unless they stopped half way through tidying. I'd prefer to put
$main:: in front rather than $:: just to make it clear.
Extensive use of globals suggests a poor design anyway unless calculation
performance is at a premium.

Regards, Peter
http://www.dragonstaff.com
Business IT Consultancy




More information about the MiltonKeynes-pm mailing list