in reply to no visibility to global hashref ?!?
You might want to return $tableName_fieldLength_hashref to the caller function when exiting the measureFieldLength and modify this function to assign that return value to the $allActivity_fieldLength_hashref global variable. Or, alternatively, work directly on the global variable within the subroutine (although this is far from being clean).
In brief, you should either decide your variables are global and, in this case, you should not pass them around as arguments (this is not the best solution, but at least it would probably work the way you want), or you don't make them global and pass them around as arguments and return values (which would be considered a better solution). But don't mix the alternatives, that's what is getting you into trouble.
Update: I would add that your program is difficult to read and to understand because your variable and function names are too long and too similar, and using CamelCase doesn't make your identifiers easy to read.
Also, why are you using subroutine prototypes? Are you sure you understand and need them?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: no visibility to global hashref ?!?
by Anonymous Monk on Jul 21, 2014 at 19:36 UTC |