develooper Front page | perl.perl6.users | Postings from September 2017

Hash and subs question

Thread Next
September 29, 2017 03:53
Hash and subs question
Message ID:
Hi All,

Looking at this test I threw together;

$ perl6 -e 'sub SayHash(%H) {say %H}; my %x = [aaa => "x", b=>"y", 

{aaa => x, b => y, c => z}

I see that SayHash(%H) will take any hash I send it.

Is there a way to make the compiler pissed if a sub does not see
the specific keys int he hash it wants?  Or do I need to use loop
with ":exists" and test each key?

Many thanks,

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About