in reply to Compilation failed, Vendor::Amazon, Vendor::BarnesNoble

Your line "'vendors' => qw(Amazon BarnesNoble) " is probably not doing what you expect.assigning a list to a scalar. This will result in the first value (Amazon) being assigned to "vendors".

Update:Valid Nit from message below has been picked.

What I think you meant is to get a REFERENCE to a list, which you can do thus:

our %CONFIG = ('db_host' => 'localhost', 'db_name' => 'books', 'db_user' => 'user', 'db_pass' => 'pass', 'html_retrieve_timeout' => 30, 'vendors' => [qw(Amazon BarnesNoble)] ); # Dereference thus: print @{$CONFIG{vendors}};
"Experience is a wonderful thing. It enables you to recognize a mistake when you make it again."

Replies are listed 'Best First'.
Re: Re: Unknown compile error - desperation
by Anonymous Monk on Feb 23, 2004 at 03:13 UTC
    I agree that the op probably wants an anonymous reference for the value of the %CONFIG{vendors}, but here's a nit.
    Your line "'vendors' => qw(Amazon BarnesNoble) " is assigning a list to a scalar. This will result in the first value (Amazon) being assigned to "vendors"

    Actually, it's assigning an odd number of elements to a hash: 'vendors', 'Amazon', 'BarnesNoble' are the last three.

that is a reference to an array
by Anonymous Monk on Feb 23, 2004 at 12:59 UTC
    This is a reference to a list
    use Data::Dumper; print Dumper( \( 1, 3, 4, 6, $_, %_ ) ); __END__ $VAR1 = \1; $VAR2 = \3; $VAR3 = \4; $VAR4 = \6; $VAR5 = \undef; $VAR6 = {};
    A list is not a data structure.