diff --git a/lib/XML/Simple.pm b/lib/XML/Simple.pm index 304ca4f..532e043 100644 --- a/lib/XML/Simple.pm +++ b/lib/XML/Simple.pm @@ -1007,7 +1007,7 @@ sub collapse { if(my $var = $self->{_var_values}) { while(my($key, $val) = each(%$attr)) { - $val =~ s{\$\{([\w.]+)\}}{ $self->get_var($1) }ge; + $val =~ s^\$\{([\w.]+)\}^ $self->get_var($1) ^ge; $attr->{$key} = $val; } } @@ -1044,7 +1044,7 @@ sub collapse { # do variable substitutions if(my $var = $self->{_var_values}) { - $val =~ s{\$\{(\w+)\}}{ $self->get_var($1) }ge; + $val =~ s^\$\{(\w+)\}^ $self->get_var($1) ^ge; } diff --git a/t/8_Namespaces.t b/t/8_Namespaces.t index 9c83f3d..7775c5d 100644 --- a/t/8_Namespaces.t +++ b/t/8_Namespaces.t @@ -122,16 +122,16 @@ $opt = { }; $xml = XMLout($opt); -like($xml, qr{ +like($xml, qr[ ^\s* - \s*<{http://www.perl.com/}element\s*>data + \s*<\{http://www.perl.com/\}element\s*>data \s* \s*$ -}sx, 'clarkian names not converted to qnames on output by default'); +]sx, 'clarkian names not converted to qnames on output by default'); # Confirm nsexpand option works on output