New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implicit EVAL in regexes (trap?) #1429
Comments
|
Oh, actually, Code: my $x = ‘Hello{say ‘boo!’}’;
say ‘#hello world’ ~~ / <{$x}> /Result: |
|
And also, let's say I want to generate some string and match against it, is it possible to do it without creating a temp variable? For example, let's say I have So far I came up with this: my $x = ‘#Hello’;
say ‘#hello world’ ~~ / <{ my $foo = $x.lc; /$foo/ }> /Maybe it works, I'm not entirely sure. But that's ridiculous anyway. What's the proper way to do it? |
|
|
|
Yup! This is it. Not sure if I've ever seen it, but definitely expected something like this. Cool, thanks. |
Let's say you have this code:
Result:
So far everything looks alright. However, let's change the input data ($x) a little bit:
Result:
So it turns out you cannot use variables with arbitrary data in
<{ }>? To be honest, I'm not entirely sure what is happening here and if it should work like this. For example, if we're in EVAL, then whyMONKEY-SEE-NO-EVALplays no role here? Would be nice to have this explained somewhere.The text was updated successfully, but these errors were encountered: