Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: Printing an Hash

by Rudolf (Monk)
on Aug 01, 2012 at 15:37 UTC ( #984818=note: print w/ replies, xml ) Need Help??

in reply to Printing an Hash

This should keep all of your indentation, though Im not aware of how you want it printed out, so I just put each key and value on a newline

use v5.14; my %hash = (' key' => 'value ',"\tkey2" => "value2\t"); open(FILE,'>>','filename') or die "$!"; while ( my($key, $value ) = each(%hash)){ print "$key\n$value\n"; print FILE "$key\n$value\n"; } close FILE;

Comment on Re: Printing an Hash
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2015-03-29 16:10 GMT
Find Nodes?
    Voting Booth?

    When putting a smiley right before a closing parenthesis, do you:

    Results (631 votes), past polls