$ perl -MO=Concise,-exec -E'my $foo = "weird123"; say $foo . do { $foo =~ s/123//; $foo };'
...
6 <;> nextstate(main 49 -e:1) v:%,{,469764096
7 <0> pushmark s
8 <0> padsv[$foo:47,49] s
9 <0> enter s
a <;> nextstate(main 48 -e:1) v:%,{,469764096
b <0> padsv[$foo:47,49] sRM
c <$> const[PV ""] s
d > subst(/"123"/) vKS
e <;> nextstate(main 48 -e:1) v:%,{,469764096
f <0> padsv[$foo:47,49] s
g <@> leave sKP
h <2> concat[t2] sK/2
i <@> say vK
...
####
use feature qw( say );
use Data::Alias qw( alias );
sub concat { my $lhs = shift; my $rhs = shift; $lhs . $rhs }
{
my $foo = "weird123";
alias push @_, $foo;
$foo =~ s/123//;
alias push @_, $foo;
alias push @_, &concat;
say shift(@_);
}
####
$ perl -MO=Concise,-exec -E'my $foo = "weird123"; say $foo . "" . do { $foo =~ s/123//; $foo };'
...
6 <;> nextstate(main 49 -e:1) v:%,{,469764096
7 <0> pushmark s
8 <0> padsv[$foo:47,49] s
9 <$> const[PV ""] s
a <2> concat[t2] sK/2
b <0> enter s
c <;> nextstate(main 48 -e:1) v:%,{,469764096
d <0> padsv[$foo:47,49] sRM
e <$> const[PV ""] s
f > subst(/"123"/) vKS
g <;> nextstate(main 48 -e:1) v:%,{,469764096
h <0> padsv[$foo:47,49] s
i <@> leave sKP
j <2> concat[t3] sKS/2
k <@> say vK
...
####
use feature qw( say );
use Data::Alias qw( alias );
sub concat { my $lhs = shift; my $rhs = shift; $lhs . $rhs }
{
my $foo = "weird123";
alias push @_, $foo;
alias push @_, "";
alias push @_, &concat;
$foo =~ s/123//;
alias push @_, $foo;
alias push @_, &concat;
say shift(@_);
}