use warnings;
use strict;
my $datamat =
"He said, »Someone once said ›This is what they said‹ but I say something else.«";
print qq{'$datamat' \n\n};
my $i = 0;
$datamat =~ s{ » (.*?) « }
{ ++$i; qq{$1}; }xmsge;
$datamat =~ s{ › (.*?) ‹ }
{ ++$i; qq{$1}; }xmsge;
print qq{[[$datamat]] \n\n};