Skip to content

Commit b9f17b9

Browse files
committed
Add an optional $ref parameter to $metaglob->add_scalar et.al.
1 parent de3fcde commit b9f17b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ppcs/ppc0022-metaprogramming.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,10 @@ method can_symbol($name)
233233
#### `add_scalar`
234234

235235
```perl
236-
$metasymbol = $metaglob->add_scalar;
236+
$metasymbol = $metaglob->add_scalar($ref);
237237
```
238238

239-
Creates a scalar variable and adds it to the glob, returning a meta-symbol object to represent it.
239+
Creates a scalar variable and adds it to the glob, returning a meta-symbol object to represent it. Optionally a reference to an existing item of the compatible type can be provided.
240240

241241
Likewise, similar would exist for the other slot types.
242242

0 commit comments

Comments
 (0)