in reply to How to set a set of our and @EXPORT variables concisely?

I must admit that I am rather confused to what you are asking. our is for declaring global variables in a Perl script. It has depreciated use vars qw(global variable list). Defining @EXPORT says which functions and variables should be exported from a Perl module by default. The two seem to be radically different to me, but maybe I am missing something?

At any rate, you should read perlman:lib:Exporter, perlman:perlmodlib and perlman:perltoot for a better idea of how Perl's OO works. Particularly with regards to exporting variables from a package.

For the second part, using our to define global variables from a list of variable names... you might want to read my post References of Eternal Peril (and it's resultant list of extremely helpful and informative replies) for some help with that. AFAIK there's no way to do it using our.

Alakaboo
"Who gave HIM a Perl interpreter?!"

  • Comment on Re: How to set a set of our and @EXPORT variables concisely?

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.