Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^10: Using 'keys' on a list (update x2)

by LanX (Sage)
on Jul 01, 2021 at 18:55 UTC ( #11134548=note: print w/replies, xml ) Need Help??


in reply to Re^9: Using 'keys' on a list (update x2)
in thread Using 'keys' on a list

>
sub f {a => 1, b=>2} my %h = (c => 3); say keys %h, f(); #output: c

This is definitely also wrong, say will print the list from f()

D:\>perl -Mfeature=say sub f {a => 1, b=>2} my %h = (c => 3); say keys %h, f(); __END__ ca1b2 D:\>

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^11: Using 'keys' on a list (update x2)
by AnomalousMonk (Bishop) on Jul 01, 2021 at 21:44 UTC
    sub f {a => 1, b=>2} my %h = (c => 3); say keys %h, f(); #output: c

    This is another example of confused or inattentive posting and editing on the part of glycine. Further on, in the "edit: my fault ..." (!) section, you will see

    sub f {a => 1, b=>2} my %h = (c => 3); say keys %h, f(); #output ca1b2


    Give a man a fish:  <%-{-{-{-<

      OK probably I didn't notice his "correction" in time.

      A regular users would have <strike> the old code, but he's new here.

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2021-12-09 09:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (36 votes). Check out past polls.

    Notices?