in reply to reuse worth it for small items?

I'll take a stab at it,

my %Control = ( ConfigData => \%ConfigData, DicomDestinations => \%DestinationData ); for my $set (qw/ConfigData DicomDestinations/) { $Data->Sql ("SELECT * FROM $set"); while ($Data->FetchRow ()) { my %x = $Data->DataHash(); $Control{$set}{$x{ID}}{$x{DataName}}= $x{DataValue}; } }
That does what you wanted at the cost of another hash.

Is it worth it? That depends on how likely it is that the two operations will diverge in the future.

Added: Another way, probably better,

sub DataClass::doit { my ($self, $set, $hash) = @_; $self->Sql ("SELECT * FROM $set"); while ($self->FetchRow ()) { my %x = $self->DataHash(); $hash->{$x{ID}}{$x{DataName}}= $x{DataValue}; } 1; } $Data->doit('ConfigData',\%ConfigData); $Data->doit('DicomDestinations', \%DestinationData);
I wrote that as an additional method wedged into $Data's class. It would be more careful to subclass that if possible. I did not wish to create a closure on $Data.

After Compline,
Zaxo