in reply to Re: Scope Between global and my
in thread Scope Between global and my

I would only use the package-global variable if other packages (or main) must have access.

In this case, just use a 'package' lexical:

package Foo; my $data; sub foo { ... } sub bar { ... } 1;