File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -529,11 +529,13 @@ introduce an alias into the symbol table.
529
529
530
530
# Available as $M::Var here.
531
531
532
- = head2 Declaring a list of variables
532
+ = head2 Declaring a list of variables lexically ( C < my > ) or package ( C < our > ) scoped
533
533
534
- The declarators C < my > and C < our > take a list of variables in parentheses as argument to declare more than one variable at a time.
534
+ It is possible to scope more than one variable at a time, but both C < my >
535
+ and C < our > require variables to be placed into parentheses:
535
536
536
- my (@a, $s, %h);
537
+ my (@a, $s, %h); # same as my @a; my $s; my %h;
538
+ our (@aa, $ss, %hh); # same as our @aa; our $ss; our %hh;
537
539
538
540
This can be used in conjunction with X « destructuring assignment » . Any
539
541
assignment to such a list will take the number of elements provided in the left
You can’t perform that action at this time.
0 commit comments