in reply to Exporting all variables and subroutines using Exporter

Exporter::Auto is on CPAN, how did you search? It only exports subroutines, though, not variables.

Your explanation of the situation is unclear. As you suspect, exporting everything is a bad idea, especially when you don't know what exactly you want to export. Also note that

@EXPORT = qw( var1 );

doesn't export $var1 , @var1 , or %var1 , but &var1 . The sigil isn't optional here.

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^2: Exporting all variables and subroutines using Exporter
by t-rex (Scribe) on Jul 13, 2016 at 17:01 UTC

    i used Exporter :: Auto and now i can export functions but variables i am unable to use , is there any way i can use the variables:

    for ex: main .pl package1.pm package2.pm package3.pm now my use case is such that package1.pm contains all the variables wh +ich will be used in main.pl and package2.pm and package3.pm

    the actual code is too large so i am just posting what exactly i want. i hope i am clear with it .