Skip to content
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

Interpolation of scalar array in regexes #39

Closed
pmichaud opened this issue May 6, 2013 · 2 comments
Closed

Interpolation of scalar array in regexes #39

pmichaud opened this issue May 6, 2013 · 2 comments

Comments

@pmichaud
Copy link
Contributor

pmichaud commented May 6, 2013

What's the result of something like...?

 my $x = [<a b c d>];  'a b c d' ~~ / $x /;

Is $x treated like a scalar, in which case the entire Array is stringified and matched, or is $x treated like an alternation of elements from the array?

Contrast with:

my @x = <a b c d>;   'a b c d' ~~ / @x /;

In this case, we know that it's an alternation of matches.

Pm

@TimToady
Copy link
Contributor

TimToady commented May 6, 2013

$x is now always stringified (no regex dwimming, no alternation semantics). Use @$x to force alternation now, and <$x> to force regex interpolation.

@TimToady TimToady closed this as completed May 6, 2013
@pmichaud
Copy link
Contributor Author

pmichaud commented May 6, 2013

For reference, the updated spec commit is f252dce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants