I think this kind of thing does what you're after: use Inline::Perl5; my $p5 = Inline::Perl5.new;
my $p5pat = '\w+'; $p5.run( 'sub chk { $_[0] =~ m/' ~ $p5pat ~ '/ }' ); subset p5_words of Str where { $p5.call( "chk", $^a ) }; my p5_words $a = "alpha"; say $a; # alpha, perl5 word chars, so acceptable to subset my p5_words $b = "^^^^^"; # Type check failed in assignment to $b; expected str_p5 but got Str ("^^^^^") # Errors out because carets don't pass \w check It could probably be cleaned up a little more, but it works. On 11/5/20, Paul Procacci <pproca...@gmail.com> wrote: > https://github.com/niner/Inline-Perl5 > > use Inline::Perl5; > > subset test of Str where EVAL "sub {@_[0] ~= m/\w+/}", :lang<Perl5>; > > > Question: Can you pass whatever {*} into eval for use in Inline::Perl5 a > la subset? > The above example is incomplete, I understand, however I'm looking to find > a method of constraining Str's w/ >perl5.8 RE's in subset's without it > getting too crazy. > > The RE's that come w/ raku proper are are much older version of RE and > cannot accomplish what I need. > > Thanks in Advance, > ~Paul > > -- > __________________ > > :(){ :|:& };: >