D
Derek Basch
Hi everyone,
I have several functions (getBillingDatabaseAttributes, etc...) that
can either return a hash reference or undefined. They just return a DBI
selectrow_hashref function such as:
$hash_ref = $dbh->selectrow_hashref($statement);
How can I merge these hashes and undefined values?
If I do this:
%hash1 = (%$hash2, %$hash3);
I get a 'cant reference undefined value' error.
Here is my attempt at an idiom to handle this. Haven't tested it:
push(@user_attributes, $self->getBillingDatabaseAttributes($user_id));
push(@user_attributes, $self->getBoardsDatabaseAttributes($user_id));
push(@user_attributes, $self->getMembersDatabaseAttributes($user_id));
foreach (@user_attributes) {
%user_attributes = (@_, %user_attributes);
}
Am I on the right track?
I have several functions (getBillingDatabaseAttributes, etc...) that
can either return a hash reference or undefined. They just return a DBI
selectrow_hashref function such as:
$hash_ref = $dbh->selectrow_hashref($statement);
How can I merge these hashes and undefined values?
If I do this:
%hash1 = (%$hash2, %$hash3);
I get a 'cant reference undefined value' error.
Here is my attempt at an idiom to handle this. Haven't tested it:
push(@user_attributes, $self->getBillingDatabaseAttributes($user_id));
push(@user_attributes, $self->getBoardsDatabaseAttributes($user_id));
push(@user_attributes, $self->getMembersDatabaseAttributes($user_id));
foreach (@user_attributes) {
%user_attributes = (@_, %user_attributes);
}
Am I on the right track?