Skip to content

Commit ce3a7c9

Browse files
committed
Further suggest that $_ should be a copy, not an alias. Maybe a readonly one at that
1 parent 5f959cd commit ce3a7c9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ppcs/ppc0027-any-and-all.md

+2
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ In any case, as junctions behave like values, they do not require special syntax
116116

117117
## Open Issues
118118

119+
* A little-used behaviour of `grep` and `map` is that the `$_` variable does not merely store a copy of each original list element but actually aliases it. This is almost never used intentionally and can often lead to accidentally modifying the original list values, leading to subtle data corruption bugs. As these proposed operators are new, there will be no compatibility issues in changing the behaviour here to say that they are copies, not aliases. Perhaps they should even be read-only copies.
120+
119121
## Copyright
120122

121123
Copyright (C) 2024, Paul Evans.

0 commit comments

Comments
 (0)