Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^3: can I change hash keys or values directly

by choroba (Archbishop)
on Jan 29, 2021 at 22:44 UTC ( #11127664=note: print w/replies, xml ) Need Help??


in reply to Re^2: can I change hash keys or values directly
in thread can I change hash keys or values directly

> perhaps keys also worked that way

No, it means you can write

#!/usr/bin/perl use warnings; use strict; use feature qw{ say }; use Syntax::Construct qw{ keys-array }; # More explicit than 5.012. my @array = qw( abc def ); my @keys = keys @array; # 0, 1 my @values = values @array; # abc, def while (my ($index, $value) = each @array) { say "$index $value"; # 0 abc, 1 def }

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2021-04-10 22:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?