- or download this
sub unroll {
my @x = $_[0] =~ /(?:^|@)((?:##|#@|[^#@])*)/g;
...
$_ =~ s/#@/@/g;
} @x
}
- or download this
unroll("#@##@###@####@#####@")
- or download this
'@#',
'#@##',
'##@',
- or download this
unroll("@@#@##@###@####@#####@")
- or download this
'',
'',
'@#',
'#@##',
'##@'
- or download this
sub my_escape {
my $x = shift;
...
sub my_join {
join('@',@_)
}
- or download this
my_join(map{my_escape($_)}('','','@#','#@##','##@',))
- or download this
'@@#@##@###@####@#####@'