71
71
hello.p6 <name>
72
72
= end code
73
73
74
- However, if give a default value for the parameter, running the script either
75
- with or without specifying a name will always work:
74
+ However, if you give a default value for the parameter, running the script
75
+ either with or without specifying a name will always work:
76
76
77
77
# inside file 'hello.p6'
78
78
sub MAIN($name = 'bashful') {
@@ -96,9 +96,9 @@ Another way to do this, is to make sub MAIN a C<multi sub>:
96
96
multi sub MAIN($name) { say "Hello $name, how are you?" }
97
97
98
98
Which would give the same output as the examples above. Whether you should
99
- use either method to achive the desired goal, is entirely up to you.
99
+ use either method to achieve the desired goal, is entirely up to you.
100
100
101
- A more complicated example using a single positional parameter, multiple
101
+ A more complicated example using a single positional and multiple
102
102
named parameters:
103
103
104
104
# inside "frobnicate.p6"
@@ -169,9 +169,10 @@ Usage:
169
169
= head2 C < %*SUB-MAIN-OPTS >
170
170
171
171
It's possible to alter how arguments are processed before they're passed
172
- to C < sub MAIN {} > by setting options in C < %*SUB-MAIN-OPTS > hash. Due to the
173
- nature of dynamic variables, it is required to set up C < %*SUB-MAIN-OPTS >
174
- hash and fill it with the appropriate settings. For instance:
172
+ to C < sub MAIN {} > by setting options in the C < %*SUB-MAIN-OPTS > hash. Due to
173
+ the nature of dynamic variables, it is required to set up the
174
+ C < %*SUB-MAIN-OPTS > hash and fill it with the appropriate settings.
175
+ For instance:
175
176
176
177
my %*SUB-MAIN-OPTS =
177
178
:named-anywhere, # allow named variables at any location
@@ -272,11 +273,11 @@ the compiler will output a default generated usage message.
272
273
EOH
273
274
}
274
275
275
- The default usage message is available inside C < sub USAGE > via read-only
276
+ The default usage message is available inside C < sub USAGE > via the read-only
276
277
C < $*USAGE > variable. It will be generated based on available C < sub MAIN >
277
- candidates and their parameters. As shown before, You can specify additional
278
- extended description for each candidate using C < #|(...) > Pod block to set
279
- L « C < WHY > |/routine/WHY» .
278
+ candidates and their parameters. As shown before, you can specify an
279
+ additional extended description for each candidate using a
280
+ C < #|(...) > Pod block to set L « C < WHY > |/routine/WHY» .
280
281
281
282
= end pod
282
283
0 commit comments