469,277 Members | 1,942 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,277 developers. It's quick & easy.

Data::Dumper How to quote keys while dumping

I am trying to dump a hash using Data::Dumper.
I need to quote the keys while dumping.

My progarm looks like this

use Data::Dumper;
$Data::Dumper::Quotekeys = 1;
$Data::Dumper::Useqq = 1;

my %tmp ;

$tmp{'1'} = "l";
$tmp{'2'} = "u";

open (STDOUT, ">");
print STDOUT Data::Dumper->Dump([\%tmp], ['*tmp']);
close STDOUT ;
---------------------------------------------------
Output
%tmp = (
1 => "l",
2 => "u"
);

---------------------------------------

i need it as

%tmp = (
'1' => "l",
'2' => "u"
);

Can anyone help out with this

Thanks
Kamal
Jul 19 '05 #1
0 1687

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Edward wijaya | last post: by
reply views Thread by Eric | last post: by
14 posts views Thread by horos | last post: by
1 post views Thread by Miguel Manso | last post: by
crazy4perl
1 post views Thread by crazy4perl | last post: by
1 post views Thread by srinivasan srinivas | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.