Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Data::Dumper How to quote keys while dumping

Reply
Thread Tools

Data::Dumper How to quote keys while dumping

 
 
kamal
Guest
Posts: n/a
 
      08-12-2003
I am trying to dump a hash using Data:umper.
I need to quote the keys while dumping.

My progarm looks like this

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

my %tmp ;

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

open (STDOUT, ">");
print STDOUT Data:umper->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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Quote-Dot-Quote Operator kvnsmnsn@hotmail.com C++ 6 06-14-2008 11:34 PM
Datagrid on load; replace all double single quote to single quote to display to user Eric Layman ASP .Net 3 04-14-2007 07:16 AM
replacing strange quote with standard quote Stimp ASP .Net 2 09-20-2006 10:01 AM
Single Quote Versus Double Quote In A href link knee-dragger@hotmail.com HTML 3 06-13-2006 12:42 AM
Data::Dumper How to quote keys while dumping kamal Perl Misc 5 08-13-2003 05:41 PM



Advertisments