in reply to @Export Quickie

Move @var_arr up and put parenthesis around the list of exported variables to toss it in a more explicit list context. It's a good idea to put your variables in @EXPORT_OK first, because someday you'll see the light and want to only export those variables that your program asks for. :)
package my_global; require Exporter; my @var_arr = qw( $var4 $var5 $var6 ); our $VERSION = 1.00; our @ISA = qw(Exporter); our @EXPORT_OK = (@var_arr, qw( $var1 $var2 $var3 )); our @EXPORT = @EXPORT_OK; # Just to test... $var1 = "hi"; $var4 = "bye"; 1;
And the test code:
use strict; use my_global; #or <B>use my_global qw($var1 $var4);</B> print "var1: $var1\n"; print "var4: $var4\n"; exit;

Replies are listed 'Best First'.
Re: Re: @Export Quickie
by dragonchild (Archbishop) on Dec 14, 2001 at 18:15 UTC
    Actually, you should never use @EXPORT unless you know why you shouldn't. :-)

    ------
    We are the carpenters and bricklayers of the Information Age.

    Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.