I want to create a library with methods A(), B(), and C() which will be called hundreds of times in each perl program with different strings as parameters. Each method updates its respective array (@A, @B, and @C) so I don't want to pass the array by reference each time. Each perl program also some unique strings they add to the array, so I cannot have the array be created and only modified by the package.
Is it possible to manipulate a shared array from the main program in a package without having to pass it through a subroutine? Is there a way to set an alias array or array pointer to reference the array in main?
main.pl
use MyPackage;
our @a;
MyPackage.pm
package MyPackage;
$alias_a = @main::a;
push @alias_a, "1";
OR
$aref = \@main::a;
push @$aref, "1";
edit: updated the OP with more background information.