You've got TWO problems. You need to limit the arguments to the grep(), and you need to use an array reference, not a list, as the value of the 'driver' key in the hash. In fact, by doing the second one, you do the first.
my %hash = (
driver => [ grep $p{rdbms} eq $_, Alzabo::Driver->available ],
rules => scalar(grep $p{rdbms} eq $_, Alzabo::RDBMSRules->available
+) ? 'yes' : 'no',
rules2 => scalar(grep $p{rdbms} eq $_, Alzabo::RDBMSRules->available
+),
);
_____________________________________________________
Jeff[japhy]Pinyan:
Perl,
regex,
and perl
hacker, who'd like a job (NYC-area)
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;
| [reply] [d/l] [select] |
Problem is not with your $rules nor $rules2, it's with your driver=> line.
Change your code to this and your code with work -
my %has =
(
# japhy was right, use [ ] to return reference to array
driver => [grep { $p{rdbms} eq $_ } Alzabo::Driver->available],
rules => (scalar grep { $p{rdbms} eq $_ } Alzabo::RDBMSRules->av
+ailable)
? 'yes' : 'no',
rules2 => (scalar grep { $p{rdbms} eq $_ } Alzabo::RDBMSRules->av
+ailable)
);
| [reply] [d/l] [select] |
The rules and rules2 lines are part of the list input to the first grep. Try: (driver => grep { $p{rdbms} eq $_ } Alzabo::Driver->available),
| [reply] [d/l] |