in reply to Re: Database Rows into Perl Hash
in thread Database Rows into Perl Hash
You could collect the bugs into actual arrays,
while( my( $comp, $bug_num ) = $sth->fetchrow_array() ) { push @{ $hash {$comp} }, $bug_num; }
Whether this is better or wors than constructing a string, of course, depends on how you intend to use the data, though even for producing strings I would generally build the arrays (I hate writing code which builds strings / tests whether the string is non-empty) and join with commas at output time: print join ", ", @{ $hash {$comp} };
Good Day,
Dean
|
|---|