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

Re: Peculiar hash behavior

by jwkrahn (Abbot)
on Oct 02, 2021 at 03:46 UTC ( [id://11137192]=note: print w/replies, xml ) Need Help??


in reply to Peculiar hash behavior

Change:

use Data::Dumper;

To:

use Data::Dumper; $Data::Dumper::Useqq = 1;
$ perl -le' use Data::Dumper; $Data::Dumper::Useqq = 1; my %h1; $h1{(1, 1)} = 17; $h1{(2, 2)} = 19; $h1{("", 22)} = 23; $h1{(22, "")} = 22; my @h = (3, 4, 5); $h1{(@h)} = 44; print Dumper(\%h1); ' $VAR1 = { "2\0342" => 19, "1\0341" => 17, "\03422" => 23, "22\34" => 22, "3" => 44 };

Or change the value of $;:

$ perl -le' use Data::Dumper; my %h1; $; = "--"; $h1{(1, 1)} = 17; $h1{(2, 2)} = 19; $h1{("", 22)} = 23; $h1{(22, "")} = 22; my @h = (3, 4, 5); $h1{(@h)} = 44; print Dumper(\%h1); ' $VAR1 = { '2--2' => 19, '--22' => 23, '3' => 44, '1--1' => 17, '22--' => 22 };

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (1)
As of 2024-04-26 02:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found