Open ribasushi opened 9 years ago
As said elsewhere Hash::Merge... has design shortcomings. In your case the problem is apparent from the following oneliner:
perl -Ilib -e ' use RapidApp::Util "merge"; use Devel::Dwarn; my $something_far_far_away = sub { Hash::Merge::set_behavior("LEFT_PRECEDENT") }; for (0, 1) { $something_far_far_away->() if $_; Dwarn [ merge( { foo => 1 }, { foo => 2 } ) ] } '
You must use an object with separate state as shown here (which fwiw can be cached). Sorry for not sending a PR - much yakshaving ahead.
As said elsewhere Hash::Merge... has design shortcomings. In your case the problem is apparent from the following oneliner:
You must use an object with separate state as shown here (which fwiw can be cached). Sorry for not sending a PR - much yakshaving ahead.