Rick Measham wrote:
The problem above is that $dt->parameters() may return a key included in %overrides. So how about $dt->parameters( %overrides )?
As I corrected myself earlier, I should have made the $dt in $dt->parameters() more generic, rather than the self-same object. I was *deliberately* illustrating that you could override those parameters by flattening the hashes.
So (a simple example...pretend I have several parameters to overide):
%parms = $dt1->parameters; %overrides = (locale => 'latvia'); $dt3->set(%parms, %overrides);
And as a convenience, I was suggesting this as equivalent:
$dt3 = $dt1->clone(%overrides);
But the same problem exists ... %parms will contain locale => 'en_AU', so your call to set is now:
$dt3->set( locale=>'en_AU', year=>2003 .. second => 27, time_zone => '-1100', locale=>'latvia' );
So which locale gets used?
Cheers! Rick