Split code and comments
my $code = q:to/END/;
print 42; # meaning of life
say "more code"; # more comment
END
my ($code-only, $comments) = [Z~] $code.lines>>.split: "#";
say $code-only;
say $comments;INFO
my $code = q:to/END/;
print 42; # meaning of life
say "more code"; # more comment
END
my ($code-only, $comments) = [Z~] $code.lines>>.split: "#";
say $code-only;
say $comments;