Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Print out hash

by marto (Cardinal)
on Feb 15, 2019 at 16:16 UTC ( [id://1229966]=note: print w/replies, xml ) Need Help??


in reply to Print out hash

Where you have:

use v5.12;

"Similarly, if the specified Perl version is greater than or equal to 5.12.0, strictures are enabled lexically as with use strict."(https://perldoc.pl/functions/use).

So to fix your code, use my:

while ( my ($key, $value) = each %count) {

Returns:

pebbles => 1 dino => 1 wlima => 1 fred => 3 barney => 2

Log In?
Username:
Password:

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

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

    No recent polls found