in reply to Make sense?
The only thing I would worry about is that there is no guarantee that keys or values called on %hash more than once will return them in the same order. And keys %hash and values %hash might not return them in the same order
At least that is what I understood. If I am wrong, please tell me. Or is this something that "works" but isn't "right"?
I would probably (untested)
l8rZ,sub _init { my ($self, %initdata) = @_; if (%initdata) { map { $self{$_} = $initdata{$_} } keys %initdata; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Make sense?
by ikegami (Patriarch) on Jul 19, 2007 at 20:13 UTC | |
|
Re^2: Make sense?
by NetWallah (Canon) on Jul 20, 2007 at 05:04 UTC |