Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: Perl Python Partial Polyglot

by 1nickt (Abbot)
on Nov 24, 2018 at 14:48 UTC ( #1226259=note: print w/replies, xml ) Need Help??


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.
$ 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.
... presumably you meant:
$ 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!?


The way forward always starts with a minimal test.

Replies are listed 'Best First'.
Re^4: Perl Python Partial Polyglot
by kschwab (Vicar) on Nov 24, 2018 at 15:00 UTC
    Nevermind, thought this was in reply to my reply.
Re^4: Perl Python Partial Polyglot
by BrowserUk (Pope) on Nov 26, 2018 at 06:18 UTC
    Ahem, both of those snippets are non-working

    And yet, somehow, my post prompted the OP to both find his own solution and post code demonstrating the original problem. Clever huh?


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
    In the absence of evidence, opinion is indistinguishable from prejudice. Suck that fhit

      Even knowing your high self-esteem I am amazed that you would claim that your erroneous contribution was so "clever" that it deserves the credit here. Most people would have said "oops."


      The way forward always starts with a minimal test.

        Whilst your making a mountain out of my typo will surprise no one!


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
        In the absence of evidence, opinion is indistinguishable from prejudice. Suck that fhit

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1226259]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2019-10-22 16:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?