List with qw and without



package MyConfig;
use constant (DOCUMENT_ROOT => "/var/www/");
require Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(DOCUMENT_ROOT); # This works
#our @EXPORT_OK = (DOCUMENT_ROOT); # But this does not work

1;

use MyConfig qw(DOCUMENT_ROOT);
print DOCUMENT_ROOT;

# If I do not use qw , I will get error of "DOCUMENT_ROOT" is not exported by the MyConfig module
# Why is qw importance is so significance here ?
# I thought qw is just a syntatic sugar of perl to make a list
# Thank you.


Send instant messages to your online friends http://uk.messenger.yahoo.com
.



Relevant Pages

  • Re: List with qw and without
    ... require Exporter; ... our @ISA = qw; ... use MyConfig qw; ... qw splits its parameter on whitespace, ...
    (perl.beginners)
  • Re: Using Variables from Another Script
    ... I tried putting the global variables in a hash in global_hash.pl as ... package MyConfig; ... The module's name is MyConfig. ... of perl as such a upgrade will affect a lot of users and current perl ...
    (comp.lang.perl.misc)