How to push a hash on an array without flattening it to Pairs?
In the first two cases the hash was converted to Pairs before assigning to the array. Only the third case gave what I hoped for. How can I push a hash onto an array as a single entity? use v6; my %h = x => 6, y => 7; say %h.perl; # {:x(6), :y(7)} my @a = %h; say @a.elems; # say @a[0]; # x => 6 my @c; @c.push(%h); say @c.elems; # 2 say @c[0]; # x => 6 my @b; @b[@b.elems] = %h; say @b.elems; # 1 say @b[0];# x => 6, y => 7
Should the use of eval recommend EVAL?
Hi, I just tried to use eval "say 19+23"; but I got: ===SORRY!=== Error while compiling a.pl Undeclared routine: eval used at line 3. Did you mean 'val'? Would it be possible to recommend 'EVAL' as well ? Gabor
require on string stopped working in rakudo 2015.09
Hi, I am really glad Rakudo finally came out. I've installed in and tried to run the tests of Perl6::Maven. They quickly failed as I have been using 'require' on string to check if all the module compile properly. The following code now fails: use v6; my $name = 'Bailador'; require $name; even though require Bailador; works. In 2015.07 both worked. I've fixed my script by switching to EVAL "use $module"; but I wonder if this is a regression or a planned deprecation? Gabor