in reply to Splitting on escapable delimiter

You can do it all in one regex:
sub unroll { my @x = $_[0] =~ /(?:^|@)((?:##|#@|[^#@])*)/g; for(@x){ $_ =~ s/##/#/g; $_ =~ s/#@/@/g; } @x }
so that:
unroll("#@##@###@####@#####@")
produces the following fully unescaped list:
'@#', '#@##', '##@',
This approach also has the benefit of handling empty sequences correctly, eg:
unroll("@@#@##@###@####@#####@")
produces:
'', '', '@#', '#@##', '##@'
as it probably should.

In general, this technique is called 'unrolling the loop' and can be found in the owl book.

To escape and join data in your way, you could use the following:
sub my_escape { my $x = shift; $x =~ s/#/##/g; $x =~ s/@/#@/g; $x } sub my_join { join('@',@_) }
Apply my_escape to each element of the list and then call my_join on it, so that:
my_join(map{my_escape($_)}('','','@#','#@##','##@',))
produces:
'@@#@##@###@####@#####@'