I've an script with a conditional and a pile of checks using the same variable. Something similar to this:
my $size = "123B";
say "OK" if $size ~~ Str && $size.ends-with("B") && $size.chop >= 0;
Would it be possible to rewrite the line in a way that would avoid the repetition of $size
?. I thought something like junctions which I have no idea how to apply to that. Or maybe something else, but shorter to my line.