=================================================================== RCS file: /cvs/RT/Invoicing/rt_invoices.pl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- RT/Invoicing/rt_invoices.pl 2011/03/21 05:01:33 1.4 +++ RT/Invoicing/rt_invoices.pl 2011/03/21 18:36:59 1.5 @@ -383,13 +383,14 @@ use 5.010; -use YAML::Any qw/ LoadFile /; +use YAML::Any qw/ LoadFile Dump Load /; sub new { my ( $class, $args ) = @_; my $self = { file => '', }; bless $self, $class; + my $file = $args->{file} || $self->_find_config; $self->read_config($file); @@ -421,7 +422,7 @@ if ( $c->{default} ) { foreach my $cust ( @{ $c->{customers} } ) { foreach my $k ( keys %{ $c->{default} } ) { - $cust->{$k} //= $c->{default}->{$k}; + $cust->{$k} //= Load( Dump( $c->{default}->{$k} ) ); } } } @@ -432,9 +433,7 @@ sub get { my ( $self, $key ) = @_; - - # XXX This should deep copy? not a reference would be good - return $self->{_config}->{$key}; + return Load( Dump( $self->{_config}->{$key} ) ); } package RTI::State;