Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: how to print key and value of hash as it is

by vinoth.ree (Monsignor)
on Jun 03, 2016 at 07:48 UTC ( #1164839=note: print w/replies, xml ) Need Help??


in reply to how to print key and value of hash as it is

Hi

Add,

use strict;
use warnings;

then run your code ?

"my" variable %hash masks earlier declaration in same scope at testt.pl line 14.
syntax error at testt.pl line 12, near "while{"
Can't use "my $a" in sort comparison at testt.pl line 17.
Update:

Hashes are not ordered, but as usual, CPAN offers a solution: Tie::IxHash


All is well. I learn by answering your questions...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2020-09-19 02:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (114 votes). Check out past polls.

    Notices?