in reply to Passing by reference from within a sub
I'm pretty sure that's because your first call of sub_c happens before it is defined, hence before its prototype is known.
The best solution is not not use prototypes, but instead pass a hash reference to sub_c, e.g. sub_c(\%hash1b);
A quick fix would be to place a "sub sub_c (\%);" before sub_b. Or, you can move sub_c before sub_b, but that won't help if the call tree is more complex than in your example.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Passing by reference from within a sub
by arvid (Initiate) on Jul 15, 2015 at 12:27 UTC |