in reply to Re^2: Perl Python Partial Polyglot
in thread Perl Python Partial Polyglot
Ahem, both of those snippets are non-working:
$ perl -Mstrict -wE 'my $h = {foo=>"bar"}; my $c = keys ${$h};' Experimental keys on scalar is now forbidden at -e line 1. Type of arg 1 to keys must be hash or array (not scalar dereference) a +t -e line 1, near "};" Execution of -e aborted due to compilation errors.
... presumably you meant:$ perl -Mstrict -wE 'my $h = {foo=>"bar"}; my $c = keys $$h;' Experimental keys on scalar is now forbidden at -e line 1. Type of arg 1 to keys must be hash or array (not scalar dereference) a +t -e line 1, near "$h;" Execution of -e aborted due to compilation errors.
$ perl -Mstrict -wE 'my $h = {foo=>"bar"}; my $c = keys %{$h};'
$ perl -Mstrict -wE 'my $h = {foo=>"bar"}; my $c = keys %$h;'
Aside: how odd that your post continues to garner upvotes (rep up three since I posted this); you don't suppose people vote based on the author's reputation without really reading the post, do you!?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Perl Python Partial Polyglot
by kschwab (Vicar) on Nov 24, 2018 at 15:00 UTC | |
|
Re^4: Perl Python Partial Polyglot
by BrowserUk (Patriarch) on Nov 26, 2018 at 06:18 UTC | |
by 1nickt (Canon) on Nov 26, 2018 at 11:16 UTC | |
by BrowserUk (Patriarch) on Nov 26, 2018 at 15:58 UTC |