Skip Menu |

This queue is for tickets about the Hash-Flatten CPAN distribution.

Report information
The Basics
Id: 128269
Status: new
Priority: 0/
Queue: Hash-Flatten

People
Owner: Nobody in particular
Requestors: oriolsoriano [...] gmail.com
UREE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Delimeters getting escaped twice
Hi, In the following scenario, I am getting delimeters escaped twice: my $struct = { property1 => { 'prometheus.io/port' => '1234', }, }; my $flattened = Hash::Flatten->new({ ArrayDelimeter => '.', HashDelimeter => '.', EscapeSequence => '#-#ESCAPE#-#', })->flatten($struct); say Dumper($struct); This outputs: { 'property1.prometheus#-#ESCAPE#-##-#ESCAPE#-#.io/port' => '1234' }; While what I was expecting is: { 'property1.prometheus#-#ESCAPE#-#.io/port' => '1234' }; The docs say about EscapeSequence: "The escaping strategy is to place the escape sequence in front of delimiter sequences; the escape sequence itself is escaped by replacing it with two instances." Judging by this, the behavior I was expecting is to get the delimeter escaped exactly once. Is this behavior I am encountering deliberate? Thanks in advance, Oriol.