Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^4: How to Map a scalar to a key that is an array?

by Laurent_R (Canon)
on Aug 01, 2019 at 21:15 UTC ( #11103738=note: print w/replies, xml ) Need Help??


in reply to Re^3: How to Map a scalar to a key that is an array?
in thread How to Map a scalar to a key that is an array?

#use strict; #use warnings;
Why do you comment out these two lines? It is usually a very bad idea.

Otherwise, the more idiomatic way to write your foreach loop would be to declare $key within the loop:

foreach my $key (keys %data) { print "$key,$data{$key}\n"; }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2020-09-22 02:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (127 votes). Check out past polls.

    Notices?