use constant PART_NUMBER => 'P/N';
print PART_NUMBER;
The above prints, "P/N", as I would expect. Later in the script I
want to access a hash value using the constant like this:
my $part = $parts{ $key }{ PART_NUMBER }; <- this doesn't work, but
this does:
my $part = $parts{ $key }{ 'P/N' }; <- works
Interesting enough if the constant is another package this would work:
my $part = $parts{ $key }{ SOME_PACKAGE::PART_NUMBER };
Any idea what I am doing wrong?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/