in reply to Sharing a variable between subroutines
Now @array is visible only within foo and bar. If you want to refer to it outside of those, you'll need to pass a copy or a reference to @array to the outside world.{ my @array; sub foo { } sub bar { } }
(update) Of course, daveorg's got the answer to the obvious XY problem.
|
|---|