in reply to Re: Make sense?
in thread Make sense?

afresh1 .. You probably meant that to be
map { $self->{$_} = $initdata{$_} } keys %initdata;
since there is no indication of the existance of a %self hash, or the relevance of such a hash to the object.
Also, there is not need for the "if" since empty "keys" will effectively convert the map to a no-op.
So your code is equivalent to the hash slice jdporter wrote.

My preference would be to simplify it to :

%$self = (%$self, %initdata);
which, although representing infinitasmally more overhead, has an elegant simplicity to it.

If you really wanted to be non-destructive of $self or $_[0], you could:

$self->{$_}=$initdata{$_} for keys %initdata;
which, to me, is slightly more readable/DWIM, compared to a "map" whose result is thrown away.

     "An undefined problem has an infinite number of solutions." - Robert A. Humphrey         "If you're not part of the solution, you're part of the precipitate." - Henry J. Tillman