in reply to sharing symbols

I like ferreira's approach better than mine, but, in the spirit of tmtowtdi, here it is anyway:
package myfile; use strict; use Exporter; our @ISA = qw(Exporter); # Setup the variables with values my $list = 'our $myvar = 42; our $another = 1234; our $yascalar = 3456;'; eval $list; $list =~ s/our (.+?)\s+= \d+;/$1/g; our @EXPORT = split("\n", $list); 1;

Not nice, but it works. Be particularly careful about whitespace when declaring the variables, it may affect the RE.