Sorry to answer my own question but...
On Aug 2, 2004, at 1:37 PM, James Edward Gray II wrote:
#!/usr/bin/perl
package MyExporter;
use strict; use warnings;
use Exporter; our @ISA = 'Exporter'; our @EXPORT = qw/ %hash routine /;
our %hash = (Test => 'Works!');
sub routine { my($caller) = caller; $$caller::hash{Another_Test} = 'Doesn\'t work!';
Changing that to:
$hash{Another_Test} = 'Now works!';
Does the trick.
}
1;
__END__
I'm confused about why the above doesn't work. Exporter isn't somehow creating a lexical variable out of that hash, is it? I guess this is my first question: What am I not understanding about the above?
I'm still a little confused about why that works. Is it because after the subroutine is "exported" it's called from inside the same namespace as the hash and can manipulate it at will? Or am I just lost (quite possible)?
Thanks again.
James
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>