Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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

by choroba (Cardinal)
on Jan 29, 2021 at 22:44 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11127664]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2024-04-19 15:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found