Can someone tell me why rules and rules2 are not being bound by the use of scalar grep? Any help is appreciated.
{ my @DRIVER = Alzabo::Driver->available; my @RULE = Alzabo::RDBMSRules->available; my $sg = (scalar grep { $p{rdbms} eq $_ } Alzabo::RDBMSRules->av +ailable); warn Data::Dumper->Dump([\@DRIVER, \@RULE, $sg], [qw(DRIVER RULE + sg)] ); my %has = ( 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) ); use Data::Dumper; die Dumper(\%has);
Carter's compass: I know I'm on the right track when by deleting something, I'm adding functionality~/hacks/gerbold/scripts $ perl s.pl $DRIVER = [ 'Gerbold', 'MySQL', 'PostgreSQL' ]; $RULE = [ 'MySQL', 'PostgreSQL' ]; $sg = 0; $VAR1 = { 'driver' => 'Gerbold' }; ~/hacks/gerbold/scripts $
In reply to scalar grep not binding hash slots by princepawn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |