You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ perl6 -e 'my $width = 4; printf("%0{$width}d", 42)'
Use of uninitialized value element of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
in block <unit> at -e line 1
Your printf-style directives specify 0 arguments, but 1 argument was supplied
in block <unit> at -e line 1
which, in my view, is a completely legit way of specifying a variable width printf format.
Turns out, this does not do what you mean. Apparently, this is short for %($/[0]).
$ perl6 -e '"abcd" ~~ m/(\w)+/; say %0'
{a => 「b」, c => 「d」}
which looks nice, but with an odd number of captures, becomes:
$ perl6 -e '"abc" ~~ m/(\w)+/; say %0'
Odd number of elements found where hash initializer expected:
Found 3 (implicit) elements:
Last element seen: Match.new(list => (), from => 2, hash => Map.new(()), made => Any, pos => 3, orig => "abc")
in block <unit> at -e line 1
This started off with:
which, in my view, is a completely legit way of specifying a variable width
printfformat.Turns out, this does not do what you mean. Apparently, this is short for
%($/[0]).which looks nice, but with an odd number of captures, becomes:
It even gets weirder with
&0:which, btw is also what
@0and$0give.I propose that
%Nand&N(where N is a 0..Inf) do not interpolate, and become syntax errors outside of interpolation.The text was updated successfully, but these errors were encountered: