File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -45,14 +45,26 @@ Returns C<True> for optional parameters.
45
45
46
46
Returns C < True > for parcel parameters.
47
47
48
- sub f(\$parcel, $non-parcel) { }
48
+ sub f(\$parcel) {
49
+ $parcel = 5;
50
+ }
51
+ f(my $x); # works
52
+ f(42); # dies in the assignment
53
+
54
+ Parcel parameters bind either a variable or a value passed to it, with
55
+ no decontainerization happen. That means that if a variable was passed
56
+ to it, you can assign to the parameter. This is different from
57
+ L < rw|#rw > -parameter which can only bind to variables, never to values.
49
58
50
59
= head2 capture
51
60
52
61
Returns C < True > for parameters that capture the rest of the argument list.
53
62
54
63
sub f(\capture) { }
55
64
65
+ Capture parameters do not force any context on the values passed bound
66
+ to them, which is why they cannot have sigils.
67
+
56
68
= head2 rw
57
69
58
70
Returns C < True > for C < is rw > parameters.
You can’t perform that action at this time.
0 commit comments